Algorithm for detecting a seizure from cardiac data

ABSTRACT

Methods, systems, and apparatus for detecting the seizure in a patient using a medical device. The determination is performed by collecting cardiac data; determining valid heart beats suitable for seizure detection from the cardiac data; calculating heart rate data of interest from the valid heart beats; and identifying a seizure event from the heart rate data. The medical device may then take a responsive action, such as warning, logging the time of the seizure, computing and storing one or more seizure severity indices, and/or treating the seizure.

FIELD OF THE INVENTION

This invention relates to medical device systems and methods capable ofdetecting and, in some embodiments, treating an occurring or impendingseizure.

DESCRIPTION OF THE RELATED ART

Of the approximately 60 million people worldwide affected with epilepsy,roughly 23 million people suffer from epilepsy resistant to multiplemedications. In the USA alone, the annual cost of epilepsy care is USD12 billion (in 1995 dollars), most of which is attributable to subjectswith pharmaco-resistant seizures. Pharmaco-resistant seizures areassociated with an increase mortality and morbidity (compared to thegeneral population and to epileptics whose seizures are controlled bymedications) and with markedly degraded quality of life for patients.Seizures may impair motor control, responsiveness to a wide class ofstimuli, and other cognitive functions. The sudden onset of a patient'simpairment of motor control, responsiveness, and other cognitivefunctions precludes the performance of necessary and even simple dailylife tasks such as driving a vehicle, cooking, or operating machinery,as well as more complex tasks such as acquiring knowledge andsocializing.

Therapies using electrical currents or fields to provide a therapy to apatient (electrotherapy) are beneficial for certain neurologicaldisorders, such as epilepsy. Implantable medical devices have beeneffectively used to deliver therapeutic electrical stimulation tovarious portions of the human body (e.g., the vagus nerve) for treatingepilepsy. As used herein, “stimulation,” “neurostimulation,”“stimulation signal,” “therapeutic signal,” or “neurostimulation signal”refers to the direct or indirect application of an electrical,mechanical, magnetic, electro-magnetic, photonic, acoustic, cognitive,and/or chemical signal to an organ or a neural structure in thepatient's body. The signal is an exogenous signal that is distinct fromthe endogenous electro-chemical activity inherent to the patient's bodyand also from that found in the environment. In other words, thestimulation signal (whether electrical, mechanical, magnetic,electro-magnetic, photonic, acoustic, cognitive, and/or chemical innature) applied to a cranial nerve or to other nervous tissue structurein the present invention is a signal applied from a medical device,e.g., a neurostimulator.

A “therapeutic signal” refers to a stimulation signal delivered to apatient's body with the intent of treating a medical condition through asuppressing (blocking) or modulating effect to neural tissue. The effectof a stimulation signal on neuronal activity may be suppressing ormodulating; however, for simplicity, the terms “stimulating”,suppressing, and modulating, and variants thereof, are sometimes usedinterchangeably herein. In general, however, the delivery of anexogenous signal itself refers to “stimulation” of an organ or a neuralstructure, while the effects of that signal, if any, on the electricalactivity of the neural structure are properly referred to as suppressionor modulation.

Depending upon myriad factors such as the history (recent and distant)of the nervous system, stimulation parameters and time of day, to name afew, the effects of stimulation upon the neural tissue may be excitatoryor inhibitory, facilitatory or disfacilitatory and may suppress,enhance, or leave unaltered neuronal activity. For example, thesuppressing effect of a stimulation signal on neural tissue wouldmanifest as the blockage of abnormal activity (e.g., epileptic seizures)see Osorio et al., Ann Neurol 2005; Osorio & Frei IJNS 2009) Themechanisms thorough which this suppressing effect takes place aredescribed in the foregoing articles. Suppression of abnormal neuralactivity is generally a threshold or suprathreshold process and thetemporal scale over which it occurs is usually in the order of tens orhundreds of milliseconds. Modulation of abnormal or undesirable neuralactivity is typically a “sub-threshold” process in the spatio-temporaldomain that may summate and result under certain conditions, inthreshold or suprathreshold neural events. The temporal scale ofmodulation is usually longer than that of suppression, encompassingseconds to hours, even months. In addition to inhibition ordysfacilitation, modification of neural activity (wave annihilation) maybe exerted through collision with identical, similar or dissimilarwaves, a concept borrowed from wave mechanics, or through phaseresetting (Winfree).

In some cases, electrotherapy may be provided by implanting anelectrical device, i.e., an implantable medical device (IMD), inside apatient's body for stimulation of a nervous tissue, such as a cranialnerve. Generally, electrotherapy signals that suppress or modulateneural activity are delivered by the IMD via one or more leads. Whenapplicable, the leads generally terminate at their distal ends in one ormore electrodes, and the electrodes, in turn, are coupled to a targettissue in the patient's body. For example, a number of electrodes may beattached to various points of a nerve or other tissue inside a humanbody for delivery of a neurostimulation signal.

While contingent (also referred to as “closed-loop,” “active,” or“feedback” stimulation (i.e., electrotherapy applied in response tosensed information, such as heart rate)) stimulation schemes have beenproposed, non-contingent, programmed periodic stimulation is theprevailing modality. For example, vagus nerve stimulation for thetreatment of epilepsy usually involves a series of grouped electricalpulses defined by an “on-time” (such as 30 sec) and an “off-time” (suchas 5 min). This type of stimulation is also referred to as “open-loop,”“passive,” or “non-feedback” stimulation. Each sequence of pulses duringan on-time may be referred to as a “pulse burst.” The burst is followedby the off-time period in which no signals are applied to the nerve.During the on-time, electrical pulses of a defined electrical current(e.g., 0.5-3.5 milliamps) and pulse width (e.g., 0.25-1.0 milliseconds)are delivered at a defined frequency (e.g., 20-30 Hz) for a certainduration (e.g., 10-60 seconds). The on-time and off-time parameterstogether define a duty cycle, which is the ratio of the on-time to thesum of the on-time and off-time, and which describes the fraction oftime that the electrical signal is applied to the nerve.

In VNS, the on-time and off-time may be programmed to define anintermittent pattern in which a repeating series of electrical pulsebursts are generated and applied to a cranial nerve such as the vagusnerve. The off-time is provided to minimize adverse effects and conservepower. If the off-time is set at zero, the electrical signal inconventional VNS may provide continuous stimulation to the vagus nerve.Alternatively, the off time may be as long as one day or more, in whichcase the pulse bursts are provided only once per day or at even longerintervals. Typically, however, the ratio of “off-time” to “on-time” mayrange from about 0.5 to about 10.

In addition to the on-time and off-time, the other parameters definingthe electrical signal in VNS may be programmed over a range of values.The pulse width for the pulses in a pulse burst of conventional VNS maybe set to a value not greater than about 1 msec, such as about 250-500μsec, and the number of pulses in a pulse burst is typically set byprogramming a frequency in a range of about 20-300 Hz (i.e., 20 pulsesper second to 300 pulses per second). A non-uniform frequency may alsobe used. Frequency may be altered during a pulse burst by either afrequency sweep from a low frequency to a high frequency, or vice versa.Alternatively, the timing between adjacent individual signals within aburst may be randomly changed such that two adjacent signals may begenerated at any frequency within a range of frequencies.

Although neurostimulation has proven effective in the treatment of anumber of medical conditions, it would be desirable to further enhanceand optimize neurostimulation-based therapy for this purpose. Forexample, it may be desirable to detect an occurring or impendingseizure. Such detection may be useful in triggering a therapy,monitoring the course of a patient's disease, or the progress of his orher treatment thereof. Alternatively or in addition, such detection maybe useful in warning the patient of an impending seizure or alerting thepatient, a physician, a caregiver, or a suitably programmed computer inorder for that person or computer program to take action intended toreduce the likelihood, duration, or severity of the seizure or impendingseizure, or to facilitate further medical treatment or intervention forthe patient. In particular, detection of an occurring or impendingseizure enables the use of contingent neurostimulation. The state of theart does not provide an efficient and effective means for performingsuch detection and/or warning. Conventional VNS stimulation as describedabove does not detect occurring or impending seizures.

Closed-loop neurostimulation therapies for treating epilepsy have beenproposed in which stimulation is triggered based upon factors includingEEG activity (see, e.g., U.S. Pat. No. 5,995,868 and U.S. Pat. No.7,280,867) as well as cardiac-based activity (see, e.g., U.S. Pat. No.6,961,618 and U.S. Pat. No. 5,928,272). EEG-based approaches involvedetermination of one or more parameters from brain electrical activitythat indicate a seizure. Such approaches have met with limited success,but have a number of drawbacks, including highly invasive andtechnically demanding surgery for implanted systems, and the poorpatient compliance for external systems (which require the patient towear electrodes on the scalp for extended periods).

Cardiac-based systems could remedy some of the difficulties of EEG-basedsystems, but to date no such systems have been commercialized.Cardiac-based detection takes advantage of the fact that certain brainstructures (central autonomic system) exert cardiac control anddepending on the structure, heart rate may be increased (tachycardia) ordecreased (bradycardia). It has been established that seizures in humansoriginating from, or spreading to central autonomic structures inducechanges in heart rate, among other cardiac indices. It must be statedthat seizure-induced tachycardia is not the result of increased motoractivity or of changes in blood gases, but a neurogenic phenomenon. Inthe present invention, a highly robust and reliable system is providedfor detecting epileptic seizures based upon cardiac data. Systems of thepresent invention are suitable for commercial, long-term implants andprovide reliable and accurate indications of seizure events for a widevariety of epilepsy patients.

SUMMARY OF THE INVENTION

In one embodiment, the present invention provides a method for detectingepileptic seizures based upon a time of beat sequence of the patient'sheart. The method comprises:

obtaining a time series of fiducial time markers for candidate heartbeats; and

detecting an epileptic seizure by at least one of

(1) forming a second window for each valid beat suitable for seizuredetection, the second window comprising a first valid beat suitable forseizure detection and at least one prior valid beat suitable for seizuredetection;

determining a foreground heart rate parameter comprising a statisticalmeasure of central tendency of heart rate in the second window;

forming a third window for each valid beat suitable for seizuredetection, the third window comprising the first valid beat suitable forseizure detection from the second window and at least two prior validbeats suitable for seizure detection;

determining a background heart rate parameter comprising a statisticalmeasure of central tendency of heart rate in the third window;

determining a relative heart rate comprising at least one of the ratioof the foreground and the background heart rate parameters and the ratioof the background and the foreground heart rate parameters; andcomparing the relative heart rate to a first seizure threshold valueassociated with an epileptic seizure event;

(2) a) determining at least one short-term heart rate comprising atleast one of

i) a first instantaneous heart rate from the first valid beat and theimmediately preceding valid beat, or

ii) a fourth window heart rate comprising a statistical measure ofcentral tendency of heart rate using the valid beats in the fourthwindow; and

b) comparing the at least one short-term heart rate to a short-termheart rate threshold associated with an epileptic seizure event;

or

(3) a) determining a fifth window heart rate comprising a statisticalmeasure of central tendency of heart rate using the valid beats in thefifth window;

b) determining a slope of the least squares linear fit of the validbeats in the fifth window;

c) comparing the fifth window heart rate to at least one of an upperfifth window heart rate threshold and a lower fifth window heart ratethreshold associated with an epileptic seizure event; and

d) comparing the slope of the least squares linear fit of the validbeats in said fifth window to at least one of a lower slope thresholdand an upper slope threshold associated with an epileptic seizure event;

further comprising, if at least one of the relative heart rate exceedsthe first seizure threshold value, the short-term heart rate exceeds theshort-term heart rate seizure threshold value, the fifth window heartrate is below the upper fifth window heart rate threshold, the fifthwindow heart rate exceeds the lower fifth window heart rate threshold,the slope of the least squares linear fit is below the upper slopethreshold, or the slope of the least squares linear fit exceeds thelower slope threshold, indicating the occurrence of a seizure event.

In one embodiment, the method further comprises identifying valid beatsfrom the candidate heart beats by subjecting a plurality of candidatebeats to at least one beat validity test, the at least one beat validitytest comprising at least one beat interval test applied to a candidatebeat interval derived from a candidate heart beat and at least onepreceding heart beat; and

accepting as valid beats the candidate beats that pass the at least onebeat validity test.

In one embodiment, the method further comprises identifying valid beatssuitable for seizure detection by forming a first window for each validbeat, the first window comprising a first valid beat and at least onepreceding heart beat;

testing the first window with at least one window test; and

accepting as suitable for seizure detection the first valid beat fromeach first window that passes the at least one window test.

In yet another aspect of the present invention, a computer readableprogram storage device is provided that is encoded with instructionsthat, when executed by a computer, perform a method described above.

In one embodiment, a medical device is provided comprising a processor,a cardiac data collector adapted to collect cardiac data, and a computerreadable program storage device as described above.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention may be understood by reference to the followingdescription taken in conjunction with the accompanying drawings, inwhich like reference numerals identify like elements, and in which:

FIG. 1A provides a stylized diagram of a medical device implanted into apatient's body for providing a therapeutic electrical signal to a neuralstructure of the patient's body, in accordance with one illustrativeembodiment of the present invention;

FIG. 1B provides a stylized diagram of a medical device implanted into apatient's body for providing a therapeutic electrical signal to a neuralstructure of the patient's body, in accordance with one illustrativeembodiment of the present invention;

FIG. 1C provides a stylized diagram of a medical device implanted into apatient's body for providing a therapeutic electrical signal to a neuralstructure of the patient's body, in accordance with one illustrativeembodiment of the present invention;

FIG. 2A is a block diagram of a medical device system that includes amedical device and an external unit, in accordance with one illustrativeembodiment of the present invention;

FIG. 2B is a block diagram of a medical device system that includes amedical device and an external unit, in accordance with one illustrativeembodiment of the present invention;

FIG. 3A is a stylized block diagram of a cardiac data collection moduleof a medical device, in accordance with one illustrative embodiment ofthe present invention;

FIG. 3B is a stylized block diagram of an heart beat/intervaldetermination module of a medical device, in accordance with oneillustrative embodiment of the present invention;

FIG. 3C is a stylized block diagram of a heart beat validation module ofa medical device, in accordance with one illustrative embodiment of thepresent invention;

FIG. 3D is a stylized block diagram of a window analysis module of amedical device, in accordance with one illustrative embodiment of thepresent invention;

FIG. 3E is a stylized block diagram of a foreground/background module ofa medical device, in accordance with one illustrative embodiment of thepresent invention;

FIG. 3F is a stylized block diagram of a seizure detection module of amedical device, in accordance with one illustrative embodiment of thepresent invention;

FIG. 4 is a block diagram of a monitoring and treatment unit, inaccordance with one illustrative embodiment of the present invention;

FIG. 5 illustrates a flowchart depiction of a method for detecting aseizure event and taking one or more responsive actions, in accordancewith an illustrative embodiment of the present invention; and

FIG. 6 illustrates a flowchart depiction of a treatment step of themethod depicted in FIG. 5, in accordance with an illustrative embodimentof the present invention.

While the invention is susceptible to various modifications andalternative forms, specific embodiments thereof have been shown by wayof example in the drawings and are herein described in detail. It shouldbe understood, however, that the description herein of specificembodiments is not intended to limit the invention to the particularforms disclosed, but on the contrary, the intention is to cover allmodifications, equivalents, and alternatives falling within the spiritand scope of the invention as defined by the appended claims.

DETAILED DESCRIPTION OF SPECIFIC EMBODIMENTS

Illustrative embodiments of the invention are described herein. In theinterest of clarity, not all features of an actual implementation aredescribed in this specification. In the development of any such actualembodiment, numerous implementation-specific decisions must be made toachieve the design-specific goals, which will vary from oneimplementation to another. It will be appreciated that such adevelopment effort, while possibly complex and time-consuming, wouldnevertheless be a routine undertaking for persons of ordinary skill inthe art having the benefit of this disclosure.

This document does not intend to distinguish between components thatdiffer in name but not function. In the following discussion and in theclaims, the terms “including” and “includes” are used in an open-endedfashion, and thus should be interpreted to mean “including, but notlimited to.” Also, the term “couple” or “couples” is intended to meaneither a direct or an indirect electrical connection. “Direct contact,”“direct attachment,” or providing a “direct coupling” indicates that asurface of a first element contacts the surface of a second element withno substantial attenuating medium there between. The presence of smallquantities of substances, such as bodily fluids, that do notsubstantially attenuate electrical connections does not vitiate directcontact. The word “or” is used in the inclusive sense (i.e., “and/or”)unless a specific use to the contrary is explicitly stated.

The term “electrode” or “electrodes” described herein may refer to oneor more stimulation electrodes (i.e., electrodes for delivering atherapeutic signal generated by an IMD to a tissue), sensing electrodes(i.e., electrodes for sensing a physiological indication of a state of apatient's body), and/or electrodes that are capable of delivering atherapeutic signal, as well as performing a sensing function.

In one embodiment, the present invention provides a method of detectinga seizure event based upon heart activity, such as a time of beatsequence of the patient's heart beat. The seizure event can be, forexample, at least one of an unstable brain state, a brain stateindicative of an elevated probability of a seizure, a brain stateindicative of an impending seizure, or a seizure, among others.

In one embodiment of the present invention, the method comprisesgenerating a time series of fiducial time markers for candidate heartbeats; identifying valid beats from the candidate heart beats;identifying valid beats suitable for seizure detection; and detecting anepileptic seizure event based upon the valid beats suitable for seizuredetection. In some embodiments, all valid beats are deemed suitable forseizure detection, while in other embodiments, additional tests, suchas, for example, one or more window tests are performed on valid beatsto identify those suitable for seizure detection.

In one embodiment, the step of identifying valid beats from candidateheart beats may be performed in a First Module that performs qualityanalysis on the candidate heart beats to distinguish physiologicallyplausible from physiologically implausible candidate heart beats. Inanother embodiment, the step of identifying valid beats suitable forseizure detection may be performed in a Second Module that performsdispersion analysis on a window formed to test each of the valid beatsto ensure that the valid beats are acceptable for use in detectingepileptic seizure events. In one embodiment, detecting an epilepticseizure event may be performed in a Third Module that detects anepileptic seizure event based upon a ratio of a measure of centraltendency of valid beats in a first, relatively short window and ameasure of central tendency of valid beats in a second window longerthan the first window. In other embodiments, a Third Module mayalternatively or in addition detect an epileptic seizure event based onother parameters calculated from valid beats.

First Module

Valid beats are identified in the method by subjecting a plurality ofcandidate beats to at least one beat validity test in which at least onecandidate beat interval is derived from a candidate heart beat and atleast one preceding heart beat, and subjected to a test to determine itsvalidity. In one embodiment the validity test comprises a test todetermine if the candidate beat interval is physiologically plausible.Regardless of which test is used, candidate beats that pass the at leastone beat validity test are accepted as valid.

In one embodiment of the invention, all candidate heart beats may beconsidered as valid beats. For extremely reliable sensing elements, orfor embodiments with low noise (e.g., intracardiac electrodes such asthose used in pacemakers), candidate heart beats may be so reliable thatbeat validity testing may be omitted.

Identifying valid beats from candidate heart beats may involve declaringinvalid candidate heart beats if the candidate beat interval is notphysiologically valid or plausible. In one embodiment, beingphysiologically invalid may mean that a candidate beat, in conjunctionwith a prior heart beat, indicates a heart rate (HR) that is outside ofphysiologically plausible upper and lower HR limits. In a particularembodiment, candidate heart beats are discarded if the candidate beatand a prior beat correspond to a heart rate that is below 35 beats perminute (BPM) or above 180 BPM. In other embodiments, candidate beats maybe discarded for other reasons including: being so long as to suggestsinus arrest (e.g., a missed heart beat), being so short as to appear tobe due to noise, having a slope (in conjunction with a prior heart beat)that is too large to be physiologically plausible (in other words, thecandidate heart beat would mean that the heart rate has experienced asudden acceleration or deceleration that is physiologicallyimplausible), or two or more of the foregoing.

Second Module

From the valid beats identified by the beat interval test, valid beatssuitable for seizure detection are identified by further testing. Thetesting involves forming a first window (which may be a time window or anumber-of-beats window) for each valid beat that includes both a firstvalid beat and at least one preceding heart beat. In one embodiment, thewindow is a backward-looking time window bounded at one end by the firstvalid beat. The first window is tested with at least one window test,and if the first window passes the at least one window test, the firstvalid beat from the window is accepted as suitable for seizuredetection.

In some embodiments of the invention, it may be unnecessary todistinguish between valid beats and valid beats suitable for seizuredetection. In such embodiments, all valid beats may be considered assuitable for seizure detection. Where this is the case, formation of afirst window, and performing dispersion and/or other tests on the firstwindow, may be omitted.

Identifying valid beats that are suitable for seizure detection mayinvolve forming a time-based or number-of-beats first window from afirst valid beat and at least one preceding heart beat, testing thefirst window, and accepting the first valid beat as suitable for seizuredetection if the first window passes the test. The first window may be,as a nonlimiting example, a 5 second window bounded on the present sideby the first valid beat (i.e., the window extends 5 seconds back in timefrom the first valid beat). Such a window may comprise, for example,from 2-15 beats in the window depending upon the patient's heart rate.Testing the first window may involve applying one or more dispersiontests to the beats in the window. Such tests allow the first valid beatto be reviewed in the context of neighboring valid beats, and thusrecent cardiac activity, to determine its suitability for use in seizuredetection calculations. In one embodiment, the dispersion test mayinvolve a short-term heart rate variability (HRV) measure of the beatsin the window. In a particular embodiment, the HRV may be calculated asthe mean squared error of a least-squares linear fit of the heart beatsin the first window. Other dispersion tests, such as other HRV tests mayalso—or alternatively—be used. Additional dispersion tests such as upperand/or lower limits for the number of beats in the window may also beused in some embodiments.

Either or both of the First Module and/or the Second Module may be usedto define valid beats, such as valid beats suitable for seizuredetection. The selection of either or both of the First and/or SecondModules may be performed according to any decision criterion orcriteria. In one embodiment, the decision criteria is responsive to atleast one parameter related to the patient's seizure history. Forexample, it may be appropriate to use both Modules if the use of onlyone Module is associated with an increase in the number of falsenegative seizure identifications and/or an increase in the severity ofthe patient's seizures. For another example, it may be appropriate touse only one Module if the use of both Modules is associated with anincrease in the number of false positive seizure identifications. Otherdecision criteria for using one or both of the First Module and/or theSecond Module can be determined as a routine matter by the person ofordinary skill in the art having the benefit of the present disclosure.

In another embodiment, valid heart beats are subjected to one or morehomogeneity tests to ensure that the candidate heart beat data iscomposed exclusively of cardiac data, and to eliminate data that is notof cardiac origin. In one embodiment, the data in the first window maybe tested to identify data with excessive variation from a centraltendency measure such as a median, mean, or an adaptive uniformdistribution-based Percentile Tracking Filter, discussed more fullyhereinafter. In a specific embodiment, the homogeneity test comprises(i) determining the median of a plurality of data points (e.g.,interpulse intervals) in the window; (ii) subtracting the median fromeach data point; (iii) determining the number of data points above andbelow the median (i.e., persistence of positive or negative values; (iv)comparing the persistence of positive and negative values to at leastone homogeneity threshold; and (v) rejecting data points exceeding thehomogeneity threshold. Homogeneity thresholds may be identified by amathematical function, or by significance tables stored in a memory.

Third Module

Epileptic seizure events are detected using valid beats, and in oneembodiment valid beats accepted as suitable for seizure detection. Thedetection involves forming a second and a third window and determining arelative heart rate (RHR) based upon a ratio of statistical measuresdetermined for each of the windows. The RHR is then compared to athreshold value for the RHR, and whether the RHR exceeds the RHRthreshold is determined. An indication of the occurrence of a seizureevent is provided based upon the comparison.

A second window (which may be a time window or a number-of-beats window)is formed for each of the valid beats suitable for seizure detection. Inone embodiment, the second window is a backward-looking time windowbounded at one end by a first valid beat suitable for seizure detectionand including at least one prior valid beat suitable for seizuredetection. In one embodiment, the second window may be the same size isthe first time window, except that valid beats that have been identifiedas suitable for seizure detection are used in it instead of simply validbeats. In a particular embodiment, the window is a three second,backward-looking window. A foreground heart rate (FHR) parameter for thesecond window is determined using a statistical measure of centraltendency of heart rate for the beats in the second window.

The second window may comprise a time window or a number-of-beatswindow. The second window, or any other window referred to herein, maybe a simple window (of finite length and with equal weighting for eachtime unit or beat unit in the window). In one embodiment, any windowreferred to herein may also be of infinite length, utilizing anynon-negative function with unit area under the curve as a time-weight.In one embodiment, any window referred to herein may be an exponentialmoving window with time constant T and corresponding timescale 1/T,which preferably weights more recent information over “exponentiallyforgotten” prior information. The time constant determines how rapidlyinformation is forgotten by controlling the decay rate of theexponential time weight.

Exponential moving windows can be easily used and readily implemented inanalog. More detail on the types of windows usable according to thepresent application can be found in U.S. Pat. Nos. 6,768,969; 6,904,390;and 7,188,053, the disclosures of which are hereby incorporated hereinby reference.

In one embodiment, the second window is a backward-looking, relativelyshort time window bounded at the present end by a first valid beat, andincluding at least one prior valid beat. In a particular embodiment, thesecond window is a three second window bounded by the first valid beaton the present side. In another embodiment, the second window is athree-beat window bounded by the first valid beat on the present side.In another embodiment, the second window is an exponentially forgettingtime window weighted to have a decay rate so that the window emphasizesinformation from a particular time duration (the timescale) or aparticular number of beats.

A foreground heart rate parameter for the second window is determinedusing a statistical measure of central tendency of heart rate orinterbeat intervals (which are inversely related to heart rate by theformula: interbeat interval (in seconds)=heart rate (in BPM)/60) for thebeats in the second window. While a number of measures (e.g., mean,median) may be used and remain within the scope of the invention, in oneembodiment, a target percentile value in a uniform distributionPercentile Tracking Filter applied to the valid beats in the secondwindow is used as the measure of central tendency. In a particularembodiment, the thirtieth (30^(th)) percentile of a uniform distributionPercentile Tracking Filter is used as the measure of central tendency.By using a percentile smaller than the 50^(th) percentile, the secondwindow will more quickly track decreases in beat interval values, whichcorresponds to increases in heart rate. Thus, in certain embodiments,this choice of a Percentile Tracking Filter may more quickly identify HRincreases than other higher percentile choices (such as the median, the50th percentile) and more quickly and robustly than other measures ofcentral tendency, such as the mean, regardless whether the mean iscomputed with or without time-weighting of information.

In one particular embodiment, the Percentile Tracking Filter is anexponentially forgetting Percentile Tracking Filter. Use of exponentialforgetting or other time-weighting methods in the measure of centraltendency may also provide faster identification of HR changes. Othertypes of forgetting, non-forgetting, weighted, and unweighted PercentileTracking Filters (or other measures of central tendency) may also beused. Examples of such filters include, by way of nonlimiting example,order statistic filters and weighted moving average filters. In oneembodiment, upper and lower limits or bounds for the uniformdistribution used in the foreground Percentile Tracking Filter may beprovided. In some embodiments these limits may be adaptively determinedbased upon the maximum and minimum value of the beat intervals in thesecond window (i.e., an “adaptive uniform distribution-based PercentileTracking Filter”), or in another window that may be larger or smallerthan the second window.

In another embodiment, the statistical measure of central tendency usedfor determining the foreground heart rate parameter is a Trimean. TheTrimean was developed by Tukey and is defined by the formula TM=¼(Q1+2M+Q3) where M is the median and Q1 and Q3 are the first and thirdquartiles. More generally, trimean values using different percentilesthan the first and third quartiles may be used through the formula TM=¼(H1+2M+H2), where M is again the median and H1 and H2 are lower andupper values known as the hinges. In one example, the lower hinge H1 maycomprise the 20^(th) percentile and the upper hinge H2 may comprise the80^(th) percentile.

The third window is next formed for each of the valid beats suitable forseizure detection. The third window is formed using the first valid beatsuitable for seizure detection from the second window, and at least twoprior valid beats. The third window may, like the second window,comprise a time or number-of-beats window. In one embodiment, the thirdwindow is a backward-looking time window that is longer than the secondwindow, bounded at the present end by the first valid beat from thesecond window, and includes at least two prior valid beats. In aparticular embodiment, the third window is a 500 second window boundedon the present side by the first valid beat from the second window,which in a specific embodiment may be implemented as anexponentially-weighted window with a 500 second timescale, such as maybe used in applying a PTF to the time series. In another embodiment, thethird window is a 500 beat window bounded on the present side by thefirst valid beat from the second window. In general, the third windowhas a larger number of beats than the second window.

A background heart rate (BHR) parameter is determined using astatistical measure of central tendency of heart rate for the beats inthe third window. As with the FHR parameter previously discussed, anumber of measures of central tendency (e.g., mean, median) may be usedand remain within the scope of the invention. In one embodiment, in oneembodiment, a target percentile value in a uniform distributionPercentile Tracking Filter applied to the valid beats in the secondwindow is used as the measure of central tendency. In a particularembodiment, the fiftieth (50^(th)) percentile of an adaptive, uniformdistribution-based Percentile Tracking Filter is used as the measure ofcentral tendency. In one particular embodiment, the Percentile TrackingFilter is an exponentially forgetting Percentile Tracking Filter. Othertypes of forgetting, non-forgetting, weighted and unweighted PercentileTracking Filters or other measures of central tendency may be used.Examples of such filters include, by way of nonlimiting example, orderstatistic filters and weighted moving average filters. Upper and lowerlimits or bounds for the uniform distribution used in the backgroundPercentile Tracking Filter may be provided. In some embodiments theselimits may be adaptively determined based upon the maximum and minimumvalue of the beat intervals in the second window, or in another windowthat may be larger or smaller than the second window.

A relative heart rate (RHR) is determined by the ratio of either the FHRand BHR parameters, or the BHR and FHR parameters. The RHR is thencompared to a seizure threshold value associated with an epilepticseizure event and it is determined whether the RHR exceeds the seizurethreshold. The method further involves indicating the occurrence of aseizure event based upon whether the RHR exceeds the threshold. In someembodiments, a duration constraint may also be imposed and the seizureevent is indicated only if the RHR exceeds the threshold for aprescribed period of time (the duration constraint).

In an exemplary embodiment of the present invention, the method furthercomprises taking a responsive action based upon the identifying theseizure event. The responsive action may include providing a warningand/or notifying the patient or a caregiver, logging the time of aseizure, computing and storing one or more seizure severity indices, ortreating the seizure event.

In one embodiment of the present invention, treating the seizure eventcomprises providing a neurostimulation therapy. The neurostimulationtherapy may involve applying an electrical, mechanical, magnetic,electro-magnetic, photonic, acoustic, and/or chemical signal to a neuralstructure of the body. The neural structure may be a brain, a spinalcord, a peripheral nerve, a cranial nerve, or another neural structure.In a particular embodiment, the responsive action comprises treating theseizure by providing a cranial nerve stimulation therapy. Cranial nervestimulation has been proposed to treat a number of medical conditionspertaining to or mediated by one or more structures of the nervoussystem, including epilepsy, movement disorders, depression, anxietydisorders and other neuropsychiatric disorders, dementia, traumaticbrain injury, coma, migraine headache, obesity, eating disorders, sleepdisorders, cardiac disorders (such as congestive heart failure andatrial fibrillation), hypertension, endocrine disorders (such asdiabetes and hypoglycemia), and pain (including neuropathic pain andfibromyalgia), among others. See, e.g., U.S. Pat. Nos. 4,867,164;5,299,569; 5,269,303; 5,571,150; 5,215,086; 5,188,104; 5,263,480;6,587,719; 6,609,025; 5,335,657; 6,622,041; 5,916,239; 5,707,400;5,231,988; and 5,330,515. Despite the numerous disorders for whichcranial nerve stimulation has been proposed or suggested as a treatmentoption, the fact that detailed neural pathways and/or mechanisms ofaction of stimulation for many (if not all) cranial nerves, and/or theresponse of such nerves to exogenous stimulation, remain relativelypoorly understood, which makes predictions of efficacy andidentification of candidates for a therapy for any given disorderdifficult or impossible.

In some embodiments, electrical neurostimulation may be provided byimplanting an electrical device underneath the skin of a patient anddelivering an electrical signal to a nerve such as a cranial nerve. Inanother alternative embodiment, the signal may be generated by anexternal pulse generator outside the patient's body, coupled by an RF orwireless link to an implanted electrode.

The cardiac data comprising a fiducial time marker for each of aplurality of heart beats can be gathered by any of a number oftechniques. For example, the cardiac data may be gathered by anelectrocardiogram (ECG) device. For another example, the cardiac datamay be gathered by a cranial nerve stimulator device. In one embodiment,the cardiac data may be related to the R-waves of the beat sequence,such as a time series of R-waves or a series of R-R intervals. Thoseskilled in the art having benefit of the present disclosure wouldappreciate that other time series of cardiac waves and/or their fiducialpoints (e.g., P waves, T waves, etc.) may be used and still remainwithin the spirit and scope of the present invention.

Data relating to R-waves may be gathered by an ECG device or, in oneembodiment, by a vagus nerve stimulator, such as described in U.S. Pat.No. 5,928,272, which is hereby incorporated by reference herein.

Receiving the cardiac data may comprise sensing a time of beat sequenceof a patient's heart and generating a time series data stream from saidtime of the beat sequence. In a further embodiment, receiving thecardiac data of the patient's heart may comprise sensing andtime-stamping a plurality of R waves, and generating the time seriesdata stream may comprise determining a series of R-R intervals from thetime stamps of the sensed R waves.

In one embodiment, the fiducial time marker is an R wave peak orthreshold crossing. The amplitude or height of one or morerepresentative R waves may be used to set a threshold that, when reachedor crossed, is registered as a fiducial time marker of a heart beat.

An interbeat interval can be calculated from a pair of said fiducialtime markers by any appropriate technique. In one embodiment, theinterbeat interval can be calculated by subtracting the time stamp of afirst fiducial time marker from the time stamp of a second fiducial timemarker following the first. In most existing HR sensing devices (forexample, exercise HR monitors), the sensor element involves sensingR-wave peaks, and interbeat intervals comprise R-R intervals constructedfrom the time stamps for the R-wave peaks. In the present invention, R-Rintervals may be used, although any consistently used fiducial markermay be employed, such as P-P intervals, T-T intervals, etc.

Under certain recording conditions, cardiac data may be relativelynoisy, and thus, spurious fiducial time markers may be collected and, asa result, spurious interbeat intervals may be generated. Includingspurious heart beats and/or interbeat intervals in later steps of themethod may lead to erroneous calculations of heart rate, which may inturn result in misidentifications of seizures (false positivedetections) and/or failures to identify seizures (false negativedetections). As a result, it is desirable to perform one or more dataquality checks or routines to eliminate spurious heart beats orinterbeat intervals from consideration by later steps of the method.Even where beats are not spurious, not all valid beats may yieldacceptable results in cardiac-based seizure detection methods.Accordingly, in some embodiments, valid beats may be subjected tofurther testing (e.g., dispersion testing in a test window) to determinewhether they are suitable for use in detecting seizures.

In one embodiment, a candidate heart beat is subjected to one or morequality tests to determine whether or not it is a valid beat suitablefor further analysis, or is an invalid beat and should be ignored. Whileany number of beat quality tests may be employed, the effects ofadditional processing time and energy usage upon the power supply inimplantable devices may result in a more limited number of tests. In oneembodiment, a first beat quality test may be performed by determining ifthe candidate heart beat interbeat interval (calculated as thedifference between the time stamp for the candidate heart beat and animmediately preceding heart beat) is not physiologically plausible. Asecond beat quality test may comprise determining if the interbeatinterval is so long as to appear to be due to a sinus arrest. A thirdbeat quality test may involve determining if the interbeat interval isso short as to appear to be due to noise. A fourth beat quality test mayinvolve calculating the absolute value of the slope of the interbeatinterval for the candidate beat and the interbeat interval for theimmediately preceding valid beat (defined as the difference between thecandidate beat interbeat interval and the interbeat interval defined bythe immediately preceding valid beat and the 2^(nd) immediatelypreceding valid beat, divided by the time difference between thecandidate beat and the immediately preceding valid beat), anddetermining whether that slope is too large to be physiologicallyplausible. In one embodiment, the slope is declared implausible (and thecandidate beat declared invalid) if the absolute value of the slope isless than or equal to 0.3. Other thresholds, such as an adaptablethreshold, may be used instead of the fixed threshold of 0.3. It will beappreciated that additional or other beat quality tests may be applied,and that only some of the foregoing quality tests may be used.Additionally, it should be noted that HR and R-R intervals can be usedinterchangeably, since they are related by the simple formula RRi=60/HR,where the R-R interval (RRi) is in seconds and HR is in BPM.

In one embodiment of the invention, the candidate heart beat is declaredinvalid (in other words, in some embodiments, not used for furtheranalysis) if the interbeat interval between the candidate beat and theimmediately preceding beat is so short that the instantaneous heart rate(IHR), defined as 60/interbeat interval, is greater than about 180 beatsper minute (BPM), 200 BPM, or 220 BPM, on the grounds that the humanheart cannot have so high an IHR even in intense exertion. In oneembodiment, the maximum possible heart rate is calculated as(220-patient's age in years) BPM, from which an interbeat intervalcorresponding thereto can be calculated and used as the minimuminterbeat interval for future calculations for that patient. In oneembodiment, the maximum heart rate is defined as 180 BPM. In otherembodiments, the patient's actual maximum HR (HR_(max)) is determinedempirically by testing and the minimum interbeat interval can be eitherstored directly from the fiducial time marker stream or determined bythe formula RR_(min)=60/(HR_(max)).

Conversely, if the interbeat interval associated with a candidate heartbeat is so long that the IHR is less than an appropriate lower limit,then the candidate heart beat can be declared invalid, on the groundsthe human heart cannot have so low an IHR, even for the heart of aperson with extreme cardiovascular fitness at rest. Although 35 BPM isan appropriate lower limit on IHR for the vast majority of epilepsypatients, another lower limit can be established by the physician inconsultation with the patient, or determined empirically from recordingthe patient's actual heart rate from which an interbeat interval can becalculated and used as the maximum interbeat interval for futurecalculations for that patient.

Where maximum and/or minimum HR or RRi values are determined empiricallyfor an individual patient, appropriate values may be determined, forexample, by using a long-term time window (e.g., 6 months, one month,two weeks, or other time period). The maximum rate may be an appropriatefunction of the actual measured heart rate in the time window. In oneembodiment, this may be a target percentage in a Percentile TrackingFilter applied to the beats in the time window.

In another embodiment, if the interbeat interval is so long as to appearto be due to sinus arrest, a candidate heart beat associated with theinterbeat interval can be declared invalid on the grounds the IHR cannotdecelerate so rapidly from one beat to the next. In one embodiment, ifthe interbeat interval is more than about 115% (or another suitablethreshold) of the immediately preceding interbeat interval, then it maylikely be that the interbeat interval is too long to reflect a validbeat and thus it can be concluded the candidate heart beat reflects amissed heart beat.

A measured interbeat interval is especially likely to result from one ormore missed heartbeats if its duration is some integer (or near-integer)multiple of 100% times the previous valid interbeat interval (e.g., 200%for one missed beat, 300% for two missed beats, etc.). This type ofmathematical analysis may also be incorporated into the beat validitytesting to specifically identify likely missed heartbeats (e.g. anymeasured RRi that is within 200%+/−10% (or other variation threshold)may be identified and logged as being a likely missed beat).

In another embodiment, if the interbeat interval is so short as toappear to be due to noise, a candidate heart beat associated with theinterbeat interval can be declared invalid on the grounds the IHR cannotincrease so rapidly from one beat to the next. In one embodiment, if theinterbeat interval is less than about 65% (or another suitablethreshold) of the immediately preceding interbeat interval, then it maybe the case that the interbeat interval is too short to reflect a validbeat and thus is can be concluded the candidate heart beat is due tonoise or is otherwise not valid.

In another embodiment, if the candidate heart beat yields an interbeatinterval having an absolute value of the slope that is too large to bephysiologically valid, it can be declared invalid on the grounds the IHRcannot accelerate or decelerate so rapidly.

In one embodiment, identifying valid beats comprises determining if eachof the plurality of candidate beats falls within a plausiblyphysiological interval.

In one embodiment, the beat validity test comprises comparing thecandidate beat interval to at least one of an upper and a lower beatinterval seizure duration threshold.

In one embodiment, the upper and lower beat interval seizure durationthresholds are derived from at least one of the patient's own heart beatdata, and heart beat data from a sample patient population based uponone or more of brain state, sex, age, weight, level of activity, time ofday, type of epilepsy, use of drugs or substances (such as food) thataffect cardiac function, ambient temperature, body temperature,respiration, and blood pressure, among others.

In one embodiment, the at least one beat interval test comprises:

a) determining that the candidate beat interval corresponds to a heartrate within a range bound by a minimum heart rate and a maximum heartrate;

b) determining that the candidate beat interval is within an acceptablepercentage of at least one of the immediately preceding valid beatinterval or a recent baseline heart rate in a predetermined time window;

c) determining that the absolute slope of the current candidate beatinterval does not correspond to a rate of acceleration or decelerationof heart rate that is physiologically improbable.

In a further embodiment, in the at least one beat interval test, theminimum heart rate is about 35 beats per minute and the maximum heartrate is about 180 beats per minute; the candidate beat interval is notmore than about 115 percent of the greater of the immediately precedingvalid beat interval or a recent baseline heart rate in a 30 second timewindow, and is at least about 65 percent of the immediately precedingvalid beat interval; and the absolute slope of the current candidatebeat interval is ≦0.3. Other thresholds may be used, and thresholds maybe altered over time according to the cardiac function of the patient.

Although any one of the grounds set forth above may be sufficient todeclare invalid a spurious candidate interbeat interval, and it is mostcomputationally efficient to declare invalid a spurious candidateinterbeat interval on the basis of a single ground, two or more of thesegrounds may be used to declare invalid a spurious candidate interbeatinterval to ensure extremely high levels of data reliability for use ina seizure detection algorithm. Noise and artifacts are often coincidentwith seizures, so the aspects of this invention that enable robustidentification of relevant cardiac rate changes in the presence of noiseand/or artifacts provide improved methods for ensuring accurate andrapid identification of seizures.

The foregoing beat quality tests may in addition be used to determine anindex of beat quality, which may be used to track data quality toidentify periods of time involving relatively good or relatively poordata quality. In one embodiment, a counter is formed for each candidateheart beat, and the counter is incremented for each test that thecandidate heart beat passes. A time stream of data quality points, withthe counter value serving as a “beat quality index” for each beat, canthen be stored and/or analyzed to, for example, obtain a mean or otherstatistical measure for a plurality of beats, which may be used toindicate periods of time in which data quality is high, low, orotherwise within or outside of acceptable limits. In other embodiments,a warning or notification may be provided to a user interface toindicate periods when data quality may need to be addressed, such aswhen a sensor element or lead has moved or broken. In such cases,seizure detection, logging, or therapy delivery may be automaticallydisabled on a temporary basis until the data quality returns to acertain level. In some cases, seizure detection, logging, or therapydelivery may be automatically disabled until the data quality returns toa certain level.

In a particular embodiment, the beat quality index is initialized to afirst value (in one example −1 is used as the initial value) prior toreceiving any information about a candidate beat. Upon the detection ofa candidate beat, the resulting candidate interbeat interval is analyzedusing a sequential set of beat interval tests and the beat quality indexis increased by 1 for each test passed. Consequently, if there are atotal of 5 tests and each are passed, the beat quality index achieves amaximum score of 4. If the first 3 tests are passed and the fourth isfailed, the candidate beat is rejected and given a beat quality score of2. Then by analyzing the sequence of beat quality indices, one mayobtain a wealth of useful information, such as (i) the average beatquality index over a moving window of time, (ii) how often each appliedtest is passed and failed (providing information about the importance ofsuch test relative to the others, which may be used to optimizecomputational efficiency of the algorithm for a particular beat detectorand typical levels of noise in the sequence of beat detections), (iii)the identification of (and possible warning/logging/other action takendue to) periods of time when heart beat detection has poor accuracy,such as when a long interval of time occurs without any (or many)detected beats being considered valid (i.e., reaching beat quality indexof 4), (iv) intervals of time with very good heart beat detectionaccuracy may be similarly identified.

The information about quality, reliability and robustness of the heartbeat detection information, which results from quantifying beat qualityin this manner, can also be used in adapting the cardiac-based seizuredetection algorithm to improve its performance (e.g., sensitivity,specificity, speed, and information yield). For example, in periods oftime that have relatively high beat detection quality index, the systemmay have high confidence in information regarding cardiac dynamics thatis extracted. This may be used to adjust detection thresholds and betterlearn both physiologic and abnormal cardiac activity patterns for thesubject. Other periods in which the beat detection is operatingrelatively poorly (as measured by the statistics of beat quality indexduring a moving window), may be avoided for learning such informationabout cardiac activity patterns. Detection decisions may also betempered during these times, for example, by raising the detectionthresholds to avoid potential detections that could be due to noise inthe beat detection system.

Even though declaring invalid spurious candidate heart beats byperforming the above techniques may provide reliable data in mostinstances, additional testing of candidate heart beats may providegreater reliability and accuracy in cardiac seizure detection algorithms(CSDAs). Because CSDAs must discriminate between heart rate changesassociated with seizures and similar increases associated withnon-pathologic events (e.g., exercise, state changes such as standing,sitting, or lying down, etc), the accuracy of the CSDA depends in partupon highly accurate heart beat detection. Accordingly, the presentinvention may involve testing candidate heart beats beyond the immediateinterbeat interval. In one embodiment, the invention involves testingcandidate heart beats in a time or number-of-beats window to determineif the candidate heart beat would result in excessive dispersion ofheart rate within the window. A candidate heart beat forming part of afirst window may be discarded if the number of beats in the window, thefit error of the beats in the window, or both fall outside of acceptablelimits.

For example, if the first time window is five seconds, and the number ofheart beats in that time window is greater than about 15 or less thanabout 3, the number of purported heart beats indicates that the mostrecent purported heart beat (which may be, for example, the heart beatforming the present side of the window) should be flagged as unsuitablefor seizure detection.

In some embodiments, the determination that a particular valid beat isnot suitable for seizure detection is only temporary and is limited to aparticular window under analysis. That is, if a valid first beat (themost recent beat in the window) fails to pass a window analysis test(along with one or more prior valid beats), the valid first beat may bediscarded only in the sense that a detection decision is suspended forthe immediate window. The very next valid beat, however (which is now a“new first beat” in a new window under analysis) may result in a windowthat passes the window analysis test, and a detection decision (usingthe “new” first beat and the previously “discarded” valid beat) may beallowed.

For another example, a least squares fit may be performed on a candidateheart beat and one or more prior beats in a window. A measure ofshort-term heart rate variability (HRVst) may be calculated as meansquare error of the least-squares fit of the heart beats in the window.If the mean squared error of the least squares fit exceeds a threshold,then the purported interbeat intervals can be concluded to possess a fiterror so high that the interbeat intervals contain one or moreartifacts, and thus the candidate heart beat (which in some embodimentsis the only new data point in the window) should be ignored. The personof ordinary skill in the art can perform and/or program a computer toperform a least squares fit as a routine matter. In one embodiment, thethreshold is 0.25.

Other measures of short-term heart rate variability may also be used.For example, the absolute prediction error obtained by comparing thecurrent interbeat interval to its predicted value, obtained using pastinterbeat intervals, can be used as a measure of short-term heart ratevariability. The predicted value used for this process could be aconstant predictor, a linear predictor, or a nonlinear predictor. Apreferred predictor would take into account the distribution ofinterbeat intervals that have previously occurred when preceded by asequence of interbeat intervals similar to those measured immediatelypreceding the moment at which the prediction is to be made. Measurescorrelated to the amount of curvature present in the interbeat intervalsequence (or its counterpart—heart rate sequence) may also be used andcorrespond to short time action by the body (e.g., sympathetic andparasympathetic activity) to intervene to change the interbeat interval(either by speeding up or slowing down the heart). It is the short-timequantification of changes in the interbeat interval sequence which thewindow analysis measures are designed to illuminate.

In one embodiment, the first window comprises one of:

a) a time window of from 1 to 10 seconds, bounded on the most recent endby the first valid beat;

b) a number beats window comprising the first valid beat and a number ofimmediately preceding beats ranging from 1-10; or

c) an exponentially forgetting window heavily weighted to the mostrecent 1 to 10 seconds, bounded on the most recent end by the firstvalid beat, or the most recent 2-11 beats.

In a further embodiment, the at least one window test comprises at leastone of:

a) determining whether the mean square error of a least squares linearfit of the beats in the first window is ≦ a predetermined heart ratevariability threshold.

In another further embodiment, the first window comprises a time windowand the at least one window test comprises determining that the numberof valid beats in the window exceeds a lower number of beats threshold.

Valid data suitable for seizure detection, as found by the abovetechniques, is available for further calculations. These furthercalculations can include the following Submodules of the Third Module.

Submodule 3A:

One series of further calculations comprises:

forming a second window for each valid beat suitable for seizuredetection, said second window comprising a first valid beat suitable forseizure detection and at least one prior valid beat suitable for seizuredetection;

determining a foreground heart rate parameter comprising a statisticalmeasure of central tendency of heart rate in said second window;

forming a third window for each valid beat suitable for seizuredetection, said third window comprising said first valid beat suitablefor seizure detection from said second window and at least two priorvalid beats suitable for seizure detection;

determining a background heart rate parameter comprising a statisticalmeasure of central tendency of heart rate in said third window;

determining a relative heart rate comprising at least one of the ratioof said foreground and said background heart rate parameters and theratio of said background and said foreground heart rate parameters; and

comparing said relative heart rate to a seizure threshold valueassociated with an epileptic seizure event.

A second window heart rate can be calculated from a second plurality ofinterbeat intervals calculated from data collected in a second timewindow. The second time window can be of any length. In one embodiment,the second time window is a time window having a duration of from about3 sec to about 5 sec. In another embodiment, the second window is anumber-of-beats window comprising from about 3 to about 15 beats. Inanother embodiment, the second time window is an exponentiallyforgetting time window having a timescale from about 3 sec to about 5sec or from about 3 beats to about 15 beats. In another embodiment, thetimescale or exponential forgetting decay factor can be made adaptive,increasing with increasing interbeat interval and decreasing withdecreasing interbeat interval, or the reverse.

The foreground heart rate (FHR or FG HR) can be calculated as astatistical measure of central tendency of HR from the beats in thesecond window. Although foreground heart rate is used for purposes ofdiscussion, it may be more accurate in some instances to calculate theforeground measure of central tendency of interbeat intervals in thewindow instead of heart rate. For example, one technique that may beused is calculation of the mean of the interbeat intervals determinedfrom the beats in the second window. In another embodiment, the medianmay be used as the measure of central tendency. In a still furtherembodiment, the FHR may be a weighted heart rate, such as anexponentially forgetting heart rate determined from a statisticalmeasure of central tendency of the beats in the window.

In one embodiment, the foreground heart rate can be calculated from theinterbeat intervals of the heart beats in the second window by use of apercentile tracking filter (PTF). A PTF has the advantage that anyoutliers that may pass the declaring invalid steps, but which would skewa calculation of the mean (sum of data points/number of data points),would be ignored. Generally, a PTF is used to track the (typicallytime-varying) n-th percentile of a set of data values in a movingwindow. When n=50, the 50-th percentile of the data is tracked, makingthe PTF output in this case somewhat akin to that of a median filter.Although the PTF is not an order statistic filter (order statistics aremuch less computationally efficient and more memory intensive andinvolve “sorting” of data which the PTF does not require), it manages toproduce an output more quickly and efficiently while retaining thedesirable outlier insensitivity of a (comparable percentile) orderstatistic filter. While the median filter is mentioned above because ofits familiarity, as with order statistic filters (a.k.a. rank filters),the PTF may track percentiles of the set of data values in a movingwindow besides the 50^(th) percentile. In particular, the PTF may takevalues representing the 30^(th) percentile.

The PTF may use a simple set of values, a weighted set of values, or theother techniques known to the person of ordinary skill in the art. Moreinformation on PTFs is given by U.S. Pat. No. 6,768,968, issued Jul. 27,2004, U.S. Pat. No. 6,904,390, issued Jun. 7, 2005, US and U.S. Pat. No.7,188,053, issued Mar. 6, 2007, the disclosures of which are herebyincorporated herein by reference in their entirety.

In addition to the foreground heart rate, embodiments of the inventionfurther comprise determining a background heart rate (BHR or BG HR) in athird window larger than the second window. Alternatively or inaddition, a third time window heart rate can be calculated from a thirdplurality of interbeat intervals calculated from data collected in athird time window longer than the second time window.

In one embodiment, the third time window is 300 sec, or an exponentiallyforgetting window heavily weighted to the most recent 300 sec.

The third time window heart rate can be calculated from the mean or thePTF of the third plurality of interbeat intervals using techniquesdiscussed above.

Alternatively or in addition, an instantaneous heart rate (IHR) can becalculated from the most recent interbeat interval. This can beroutinely done as 60/interbeat interval, with resulting units of beatsper minute (BPM or bpm).

The background heart rate can be calculated from the interbeat intervalsof the valid beats in the third window. In one embodiment, the thirdwindow is a time window longer than the second window, and in aparticular embodiment the third window is a time window having aduration of from 10 seconds to 86,400 seconds. In a more particularembodiment the third window is a 500 second time window. In anotherembodiment, the third window is a number-of-beats window comprising fromabout 30 to about 175,000 beats, and in a particular embodiment thethird window is a 500 beat window. In another embodiment, the thirdwindow is an exponentially forgetting window with a timescale of about10 sec to about 86,400 sec or about 30 beats to about 175,000 beats.

The BHR can be calculated as a statistical measure of central tendencyof HR from the beats in the third window by techniques similar to thosediscussed previously for the foreground heart rate. Although BHR is usedfor purposes of discussion, it may be more accurate in some instances tocalculate the background median value (as measured, for example, by a50^(th) percentile PTF) of interbeat intervals in the window instead ofheart rate. For example, one technique that may be used is calculationof the mean of the interbeat intervals determined from the beats in thewindow. In another embodiment, the median may be used as the measure ofcentral tendency. In a still further embodiment, the BHR may be aweighted heart rate, such as an exponentially forgetting heart ratedetermined from a statistical measure of central tendency of the beatsin the window. In a particular embodiment, the BHR is calculated as atarget percentile value (e.g., the 50^(th) percentile) of a PercentileTracking Filter applied to the beats in the third window.

In many embodiments, indicating the occurrence of a seizure event may bemade whenever it is determined that the RHR exceeds (i.e., firstcrosses) the threshold associated with a seizure event. However, in someembodiments, the indicating is made only after one or more additionalrequirements are satisfied. Such additional constraints, which mayinclude a multiple additional constraints, may be helpful in eliminatingor reducing false positive and/or false negative event detectionindications.

For example, indicating the occurrence of a seizure may require, inaddition to RHR instantaneously exceeding the seizure threshold (i.e.,crossing the threshold for a single heart beat), that the RHR exceed thethreshold for a desired duration, which defines a seizure durationthreshold or duration constant. Thus, in one nonlimiting example, aseizure indication may only be generated when the RHR exceeds thethreshold continuously for 5 seconds.

The seizure duration threshold may also vary depending upon factors suchas those discussed previously as providing a basis for making the firstseizure threshold itself adaptive (i.e., the threshold is automaticallymodified based on the patient's level of exertion, the time of day,week, or month, false positive or negative seizure detections, changesin the state, high-risk activities such as swimming or driving, etc.).For example, the exertional state of the patient may be used to impose aduration constraint where none is usually present (or to remove aduration threshold otherwise present), such as a duration constraintonly during periods of exercise, or during sleep or rest periods. Inanother nonlimiting example, an indication of a seizure is made only ifRHR exceeds the seizure threshold for 15 seconds, but if the patient hasexperienced a seizure event within the last hour, the durationconstraint is reduced or eliminated altogether. In another non-limitingexample, the threshold value associated with a seizure event isdecreased if the subject's heart rate following a seizure remains abovethe subject's heart rate baseline for a given activity level, time ofday, etc. In other instances, a duration constraint may be imposed orincreased depending upon particular conditions.

In another embodiment, in addition to the FHR and BHR, one or moreadditional heart rates may be calculated similarly to the foreground andbackground heart rates discussed above, differing primarily in thelength of the time window used to calculate these additional heartrates. These additional heart rates may be termed “midground heartrates” or “medium-term heart rates” if the time window is intermediatein length to the second window and the third window, “ultra-foregroundheart rates” or “very-short-term heart rates” if the time window isshorter than the second window, “ultra-background heart rates” or“very-long-term heart rates” if the time window is longer than the thirdwindow.

In another embodiment, the FHR, BHR, or RHR can be analyzed for patternsindicative of a seizure event.

Submodule 3B:

Another series of further calculations comprises:

a) determining at least one short-term heart rate comprising at leastone of

i) a first instantaneous heart rate from a first valid beat and theimmediately preceding valid beat, or

ii) a fourth window heart rate comprising a statistical measure ofcentral tendency of heart rate using said valid beats in said fourthwindow; and

b) comparing said at least one short-term heart rate to a short-termheart rate threshold associated with a seizure event.

In one embodiment, a short-term HR may comprise a first instantaneous HRusing the first valid beat in the background HR window and the validbeat immediately preceding the first valid beat. In another embodiment,a short-term HR may comprise the median HR for the foreground HR window.In this embodiment, an indication of seizure occurrence may be made onlyif both the RHR seizure threshold is exceeded and the short-term HR(however measured) exceeds the short-term HR threshold.

A short-term HR threshold may be useful to a physician who finds, e.g.,that the RHR threshold constraint alone yields an unacceptably high anumber of false positive seizure indications. For example, if theshort-term HR threshold value is set at 100 BPM, and is combined withrequirement that the RHR exceed 1.3, then a patient with a resting heartrate of 60 performing some mild exertion (climbing stairs, engaged in anemotionally charged encounter, etc.) which raises his heart rate to 80(60 times 1.333) would not be flagged as having a seizure event becausethe short-term HR threshold constrain of 100 BPM was not met.

Submodule 3C:

A third series of further calculations comprises:

a) determining a fifth window heart rate comprising a statisticalmeasure of central tendency of heart rate using said valid beats in saidfifth window;

b) determining a slope of the least squares linear fit of the beats insaid fifth window;

c) comparing said fifth window heart rate to at least one of an upperfifth window heart rate threshold and a lower fifth window heart ratethreshold associated with a seizure event;

d) comparing said slope of the least squares linear fit to at least oneof a lower slope threshold and an upper slope threshold associated witha seizure event.

In one embodiment, detecting an epileptic seizure comprises the use ofSubmodule 3A as discussed above.

In one embodiment of Submodule 3A, determining a foreground heart rateparameter comprises determining, from the valid beats in the secondwindow, a target percentile value in a uniform distribution PercentileTracking Filter.

In a further embodiment, the upper and lower bounds for the uniformdistribution are adaptively determined for each second window based uponthe maximum and minimum beat intervals in the second window.

In another further embodiment, the target percent value of thePercentile Tracking filter comprises a value in the range of 20 percentto 80 percent. In an even further embodiment, the Percentile TrackingFilter comprises an adaptive uniform distribution with endpointparameters determined using exponential forgetting factor, with aprescribed forgetting factor corresponding to a 5 sec timescale, and thetarget percent value of the Percentile Tracking Filter is 30 percent.

In one embodiment, determining a background heart rate parametercomprises determining, from the valid beats in the third window, atarget percentile value in an adaptive uniform distribution PercentileTracking Filter.

In one embodiment, the method further comprises determining a durationof time that the relative heart rate exceeds the first seizurethreshold, and wherein indicating the occurrence of a seizure event isonly performed if the duration exceeds a seizure duration threshold.

In one embodiment, indicating the occurrence of a seizure eventcomprises generating a signal if the relative heart rate exceeds thefirst seizure threshold if one or more of

a) said relative heart rate exceeds said first seizure threshold;

b) said fifth window heart rate is below said upper fifth window heartrate threshold and exceeds said lower fifth window heart rate threshold;or

c) said slope of the least squares linear fit at least one of

-   -   i) exceeds said lower slope threshold and    -   ii) is below said upper slope threshold.

In some embodiments, one or more of the above thresholds may, in certainconditions, be set to +/− infinity (to either block detection or makethis detection component always in a state of detection). Moregenerally, if the relative heart rate is within a prescribed range ortakes on certain values, as represented by appropriate thresholds, allthese measures together may be considered with a appropriate weightingfactors to determine whether or not to issue a detection decision.

In particular embodiments, one, two or all three of the foregoingconditions may be required to issue a seizure detection indication. Inalternative embodiments, additional constraints may also be required tobe met before issuing an indication of a seizure detection. Thus, anyoneor more of the three series of calculations set forth above may becombined by any appropriate logical operator, e.g., AND, OR, XOR, NOT,or the like, and/or grouped together (e.g., of the form “x AND (y ORz),” among others). For example, a short term heart rate more than,e.g., 120% of the background HR for more than 15 sec may be indicativeof a seizure, alone or in combination with a RHR threshold constraint.For another nonlimiting example, a slope of heart rate more than, e.g.,0.03 beats/second for 5 sec may be indicative of a seizure. The precisevalues of the thresholds and durations can be set by the physician inconsultation with the patient or adaptively.

However the seizure event is identified, in some embodiments, aresponsive action may be taken selected from warning, logging the timeof a seizure, computing and storing one or more seizure severityindices, or treating the seizure.

A seizure event warning may be given as, for example, a warning tone orlight implemented by a medical device or a device adapted to receiveindications of the seizure; as an automated email, text message,telephone call, or video message sent from a medical device or a unit incommunication with a medical device to the patient's cellular telephone,PDA, computer, television, 911 or another emergency contact number forparamedic/EMT services, etc. Such a warning may allow the patient or hisor her caregivers to take measures protective of patient's well-beingand those of others, e.g., pulling out of traffic and turning off a car,when the patient is driving; stopping the use of machinery, contactinganother adult if the patient is providing childcare, removing thepatient from a swimming pool or bathtub, lying down or sitting if thepatient is standing, etc.

The time may be logged by receiving an indication of the current timeand associating the indication of the current time with an indication ofthe seizure.

Seizure severity indices may be calculated and stored by appropriatetechniques and apparatus.

The seizure may be treated by appropriate techniques, such as thosediscussed below. The treatment may be one or more treatments known inthe art. In one embodiment, the treatment comprises at least one ofapplying an electrical signal to a neural structure of a patient;delivering a drug to a patient; or cooling a neural structure of apatient. When the treatment comprises applying an electrical signal to aportion of a neural structure of a patient, the neural structure may beat least one of a portion of a brain structure of the patient, a portionof a cranial nerve of a patient, a portion of a spinal cord of apatient, a portion of a sympathetic nerve structure of the patient, aportion of a parasympathetic nerve structure of the patient, and/or aportion of a peripheral nerve of the patient.

Though not intended to be bound by theory, in certain circumstances, aseizure may be identified from heart rate data at a time before seizureonset as determined by electroencephalography, observation by aphysician or knowledgeable layman, or both. The time before onset mayrange from a few seconds up to a few minutes. As such, certainembodiments of the method may be considered to yield a prediction of aseizure. It should be noted that the prediction may sometimes be a falsepositive. However, depending on a physician's judgment, his or herunderstanding of the devices in use, and the patient's condition, acertain amount of false positives may be tolerable.

The above method can be performed alone. In one embodiment, the abovemethod can be performed in combination with a continuous or open-looptherapy for epilepsy. In one embodiment, the above method is performedto take action in response to the detection of the seizure, and at allor most other times, a chronic therapy signal is applied to a targetstructure in the patient's body. In one embodiment, the target structureis a cranial nerve, such as the vagus nerve.

In one embodiment, the method described above comprises:

obtaining a time series of fiducial time markers for candidate heartbeats;

identifying valid beats from the candidate heart beats, as describedabove;

accepting as valid beats the candidate beats that pass the at least onebeat validity test; and

detecting an epileptic seizure by at least one of the series ofcalculations described above. In other words, in this embodiment, themethod can be performed without performing a window test.

In one embodiment, the method described above comprises:

obtaining a time series of fiducial time markers for candidate heartbeats; and

detecting an epileptic seizure by at least one of the series ofcalculations described above. In other words, in this embodiment, themethod can be performed without performing both a beat validity test anda window test.

Embodiments wherein a beat validity test and/or a window test are notperformed may be particularly suitable for situations wherein thequality of fiducial time markers for candidate heart beats is very high,or where the practitioner would find acceptable a possible higher rateof false positive seizure event determinations resulting from “noisy”data.

Although not limited to the following, an exemplary system capable ofimplementing embodiments of the present invention is described below.FIG. 1A depicts a stylized implantable medical system (IMD) 100 forimplementing one or more embodiments of the present invention. Anelectrical signal generator 110 is provided, having a main body 112comprising a case or shell with a header 116 for connecting to aninsulated, electrically conductive lead assembly 122. The generator 110is implanted in the patient's chest in a pocket or cavity formed by theimplanting surgeon just below the skin (indicated by a dotted line 145),similar to the implantation procedure for a pacemaker pulse generator.

A nerve electrode assembly 125, preferably comprising a plurality ofelectrodes having at least an electrode pair, is conductively connectedto the distal end of the lead assembly 122, which preferably comprises aplurality of lead wires (one wire for each electrode). Each electrode inthe electrode assembly 125 may operate independently or alternatively,may operate in conjunction with the other electrodes. In one embodiment,the electrode assembly 125 comprises at least a cathode and an anode. Inanother embodiment, the electrode assembly comprises one or moreunipolar electrodes.

Lead assembly 122 is attached at its proximal end to connectors on theheader 116 of generator 110. The electrode assembly 125 may besurgically coupled to the vagus nerve 127 in the patient's neck or atanother location, e.g., near the patient's diaphragm or at theesophagus/stomach junction. Other (or additional) cranial nerves such asthe trigeminal and/or glossopharyngeal nerves may also be used todeliver the electrical signal in particular alternative embodiments. Inone embodiment, the electrode assembly 125 comprises a bipolarstimulating electrode pair 126, 128 (i.e., a cathode and an anode).Suitable electrode assemblies are available from Cyberonics, Inc.,Houston, Tex., USA as the Model 302 electrode assembly. However, personsof skill in the art will appreciate that many electrode designs could beused in the present invention. In one embodiment, the two electrodes arewrapped about the vagus nerve, and the electrode assembly 125 may besecured to the vagus nerve 127 by a spiral anchoring tether 130 such asthat disclosed in U.S. Pat. No. 4,979,511 issued Dec. 25, 1990 to ReeseS. Terry, Jr. Lead assembly 122 may be secured, while retaining theability to flex with movement of the chest and neck, by a sutureconnection to nearby tissue (not shown).

In alternative embodiments, the electrode assembly 125 may comprisetemperature sensing elements, blood pressure sensing elements, and/orheart rate sensor elements. Other sensors for other body parameters mayalso be employed. Both passive and active stimulation may be combined ordelivered by a single IMD according to the present invention. Either orboth modes may be appropriate to treat a specific patient underobservation.

In alternative embodiments, the implantable medical device systemfurther comprises an electrical stimulator comprising an electrode 160(not to scale) adapted to be coupled to the spinal cord 180 (FIG. 1B) orto a region of the brain 190 (FIG. 1C). The physician can select preciselocations for coupling to the spinal cord 180 or brain 190 based on hisor her observations of the patient's medical condition, among othervalues. In various embodiments, the implantable medical device systemmay comprise one, two, or three of the IMD 100, the spinal cordstimulator, and the brain stimulator.

The electrical pulse generator 110 may be programmed with an externaldevice (ED) such as computer 150 using programming software known in theart. A programming wand 155 may be coupled to the computer 150 as partof the ED to facilitate radio frequency (RF) communication between thecomputer 150 and the pulse generator 110. The programming wand 155 andcomputer 150 permit non-invasive communication with the generator 110after the latter is implanted. In systems where the computer 150 usesone or more channels in the Medical Implant Communications Service(MICS) bandwidths, the programming wand 155 may be omitted to permitmore convenient communication directly between the computer 150 and thepulse generator 110.

Turning now to FIG. 2, a block diagram depiction of a medical device 200is provided, in accordance with one illustrative embodiment of thepresent invention.

In some embodiments, the medical device 200 may be implantable (such asimplantable electrical signal generator 110 from FIG. 1), while in otherembodiments the medical device 200 may be completely external to thebody of the patient.

The medical device 200 (such as generator 110 from FIG. 1) may comprisea controller 210 capable of controlling various aspects of the operationof the medical device 200. The controller 210 is capable of receivinginternal data or external data, and in one embodiment, is capable ofcausing a stimulation unit 220 (FIG. 2B) to generate and deliver anelectrical signal to target tissues of the patient's body for treating amedical condition. For example, the controller 210 may receive manualinstructions from an operator externally, or may cause the electricalsignal to be generated and delivered based on internal calculations andprogramming. In other embodiments, the medical device 200 does notcomprise a stimulation unit 220 (FIG. 2A). In either embodiment, thecontroller 210 is capable of affecting substantially all functions ofthe medical device 200.

The controller 210 may comprise various components, such as a processor215, a memory 217, etc. The processor 215 may comprise one or moremicrocontrollers, microprocessors, etc., capable of performing variousexecutions of software components.

The memory 217 may comprise various memory portions where a number oftypes of data (e.g., internal data, external data instructions, softwarecodes, status data, diagnostic data, etc.) may be stored. The memory 217may comprise one or more of random access memory (RAM), dynamic randomaccess memory (DRAM), electrically erasable programmable read-onlymemory (EEPROM), flash memory, etc.

As stated above, in one embodiment, the medical device 200 may alsocomprise a stimulation unit 220 capable of generating and deliveringelectrical signals to one or more electrodes 126, 128 via leads 201(FIG. 2B). A lead assembly such as lead assembly 122 (FIG. 1) may becoupled to the medical device 200. Therapy may be delivered to the leads201 comprising the lead assembly 122 by the stimulation unit 220 basedupon instructions from the controller 210. The stimulation unit 220 maycomprise various circuitry, such as electrical signal generators,impedance control circuitry to control the impedance “seen” by theleads, and other circuitry that receives instructions relating to thedelivery of the electrical signal to tissue. The stimulation unit 220 iscapable of delivering electrical signals over the leads 201 comprisingthe lead assembly 122. As should be apparent, in certain embodiments,the medical device 200 does not comprise a stimulation unit 220, leadassembly 122, or leads 201.

In other embodiments, a lead 201 is operatively coupled to an electrode,wherein the electrode is adapted to couple to at least one of a portionof a brain structure of the patient, a cranial nerve of a patient, aspinal cord of a patient, a sympathetic nerve structure of the patient,or a peripheral nerve of the patient.

The medical device 200 may also comprise a power supply 230. The powersupply 230 may comprise a battery, voltage regulators, capacitors, etc.,to provide power for the operation of the medical device 200, includingdelivering the therapeutic electrical signal. The power supply 230comprises a power source that in some embodiments may be rechargeable.In other embodiments, a non-rechargeable power source may be used. Thepower supply 230 provides power for the operation of the medical device200, including electronic operations and the electrical signalgeneration and delivery functions. The power supply 230 may comprise alithium/thionyl chloride cell or a lithium/carbon monofluoride (LiCFx)cell if the medical device 200 is implantable, or may compriseconventional watch or 9V batteries for external (i.e., non-implantable)embodiments. Other battery types known in the art of medical devices mayalso be used.

The medical device 200 may also comprise a communication unit 260capable of facilitating communications between the medical device 200and various devices. In particular, the communication unit 260 iscapable of providing transmission and reception of electronic signals toand from a monitoring unit 270, such as a handheld computer or PDA thatcan communicate with the medical device 200 wirelessly or by cable. Thecommunication unit 260 may include hardware, software, firmware, or anycombination thereof.

The medical device 200 may also comprise one or more sensor(s) 212coupled via sensor lead(s) 211 to the medical device 200. The sensor(s)212 are capable of receiving signals related to a physiologicalparameter, such as the patient's heart beat, blood pressure, and/ortemperature, and delivering the signals to the medical device 200. Inone embodiment, the sensor(s) 212 may be the same as implantedelectrode(s) 126, 128 (FIG. 1). In other embodiments, the sensor(s) 212are external structures that may be placed on the patient's skin, suchas over the patient's heart or elsewhere on the patient's torso.

In one embodiment, the medical device 200 may comprise a cardiac datacollection module 265 that is capable of collecting cardiac datacomprising fiducial time markers of each of a plurality of heart beats.The cardiac data collection module 265 may also process or condition thecardiac data. The cardiac data may be provided by the sensor(s) 212. Thecardiac data collection module 265 may be capable of performing anynecessary or suitable amplifying, filtering, and performinganalog-to-digital (A/D) conversions to prepare the signals fordownstream processing. The cardiac data collection module, in oneembodiment, may comprise software module(s) that are capable ofperforming various interface functions, filtering functions, etc., toprocess fiducial time markers of each of a plurality of heart beats. Inanother embodiment the cardiac data collection module 265 may comprisehardware circuitry that is capable of performing these functions. In yetanother embodiment, the cardiac data collection module 265 may comprisehardware, firmware, software and/or any combination thereof. A moredetailed illustration of the cardiac data collection module 265 isprovided in FIG. 3A and accompanying description below.

The cardiac data collection module 265 is capable of collecting cardiacdata comprising fiducial time markers of each of a plurality ofcandidate heart beats and providing the collected cardiac data to anheart beat/interval determination module 275. Based upon the signalsprocessed by the cardiac data collection module 265, the heartbeat/interval determination module 275 may calculate an interbeatinterval from a consecutive pair of said fiducial time markers and storesuch interbeat interval or forward it on for furtherprocessing/analysis. The heart beat/interval determination module 275may comprise software module(s) that are capable of performing variousinterface functions, filtering functions, etc., to calculate interbeatintervals. In another embodiment the heart beat/interval determinationmodule 275 may comprise hardware circuitry that is capable of performingthese functions. In yet another embodiment, the heart beat/intervaldetermination module 275 may comprise hardware, firmware, softwareand/or any combination thereof. Further description of the heartbeat/interval determination module 275 is provided in FIG. 3B andaccompanying description below.

The heart beat/interval determination module 275 is capable ofcalculating an interbeat interval from a consecutive pair of saidfiducial time markers and providing the interbeat interval to the heartbeat validation module 285. Based upon the interbeat interval receivedby the heart beat validation module 285, it performs any operationsdesired to identify invalid interbeat intervals and discard them. Forexample, the heart beat validation module 285 may discard the candidateheart beat if the interbeat interval formed from the candidate heartbeat and the immediately preceding valid beat is not physiologicallyvalid, is so long as to appear to be due to a missed heart beat, is soshort as to appear to be due to noise, has an absolute value of theslope of the interbeat interval that is too large to be physiologicallyvalid, or two or more thereof. The heart beat validation module 285 maycomprise software module(s) that are capable of performing variousinterface functions, filtering functions, etc., to discard invalidbeats. In another embodiment the heart beat validation module 285 maycomprise hardware circuitry that is capable of performing thesefunctions. In yet another embodiment, the heart beat validation module285 may comprise hardware, firmware, software and/or any combinationthereof. Further description of the heart beat validation module 285 isprovided in FIG. 3C and accompanying description below.

The heart beat validation module 285 is capable of declaring invalidbeats and forwarding a plurality of heart beats accepted as valid towindow analysis module 295. Based upon the plurality of valid beatsreceived by the window analysis module 295, it performs any operationsdesired to perform further testing of the valid beats in one or moreheart beat windows to identify valid beats suitable for seizuredetection. For example, the window analysis module 295 may discard aplurality of valid beats as unsuitable for seizure detection if thenumber, the heart rate variability, or both of a window analysisperformed on the valid beat in a backward-looking window fail to pass anumber-of-beats threshold and/or a HRV threshold. The window analysismodule 295 may comprise software module(s) that are capable ofperforming various interface functions, filtering functions, etc., toreject valid beats as unsuitable for seizure detection. In anotherembodiment the window analysis module 295 may comprise hardwarecircuitry that is capable of performing these functions. In yet anotherembodiment, the window analysis module 295 may comprise hardware,firmware, software and/or any combination thereof. Further descriptionof the window analysis module 295 is provided in FIG. 3D andaccompanying description below.

The window analysis module 295 is capable of ignoring one or more validbeats that are unsuitable for seizure detection, and forwarding aplurality of valid interbeat intervals that are suitable for seizuredetection to foreground/background module 297. (The terms “flagging,”“ignoring,” and “discarding” may be used herein to refer to not usingone or more valid beats for seizure detection). Based upon the pluralityof interbeat intervals received from the window analysis module 295, theforeground/background module 297 performs any operations not performedin prior modules (such as interbeat interval calculation module 275,heart beat validation module 285, and window analysis module 295) andnecessary or desirable for use in detection of seizures. In addition todetermination of foreground HR and background HR, foreground/backgroundmodule 297 may calculate, for example, various heart rates, durations,slopes, HRV measures, or other parameters associated with the foregroundand background windows. For example, the foreground/background module297 may calculate a second time window heart rate from a plurality ofconsecutive interbeat intervals calculated from data collected in asecond time window, a third time window heart rate from a plurality ofconsecutive interbeat intervals calculated from data collected in athird time window, a first instantaneous heart rate from said firstvalid beat and the immediately preceding valid beat, a fourth windowheart rate comprising a statistical measure of central tendency of heartrate using said valid beats in said first window, a fifth window heartrate comprising a statistical measure of central tendency of heart rateusing valid beats in a fifth window, slope of the least squares linearfit of the beats in said fifth window, or two or more thereof.

The foreground/background module 297 may comprise software module(s)that are capable of performing various interface functions, filteringfunctions, etc., to calculate the various heart rates, slopes of heartrate series, durations of heart rates or slopes of heart rates abovevarious seizure threshold values, or the like. In another embodiment theforeground/background module 297 may comprise hardware circuitry that iscapable of performing these functions. In yet another embodiment, theforeground/background module 297 may comprise hardware, firmware,software and/or any combination thereof. Further description of theforeground/background module 297 is provided in FIG. 3E and accompanyingdescription below.

The foreground/background module 297 is capable of calculating variousheart rates, slopes of heart rate series, durations of heart rates orslopes of heart rates above various seizure threshold values, or thelike and forwarding the calculated information to seizure detectionmodule 299. Based upon the calculated information received by theseizure detection module 299, it performs any operations desired toidentify a seizure event. For example, the seizure detection module 299may identify a seizure event based on one or more of a foreground HRfrom the second window heart rate from a plurality of valid beatssuitable for seizure detection in the second window, the backgroundheart rate from a plurality of valid beats suitable for seizuredetection in the third window, a duration that a short-term heart ratemeasure exceeds a short-term heart rate threshold, a duration that aslope of a short-term heart rate, whether a short-term HRV measureexceeds an HRV threshold, two or more of the foregoing, or at least oneor more relationships between two or more of the foregoing. The seizuredetection module 299 may comprise software module(s) that are capable ofperforming various interface functions, filtering functions, etc., toidentify a seizure event. In another embodiment the seizure detectionmodule 299 may comprise hardware circuitry that is capable of performingthese functions. In yet another embodiment, the seizure detection module299 may comprise hardware, firmware, software and/or any combinationthereof. Further description of the seizure detection module 299 isprovided in FIG. 3F and accompanying description below.

In addition to components of the medical device 200 described above, animplantable medical system may comprise a storage unit to store anindication of at least one of seizure or an increased risk of a seizure.The storage unit may be the memory 217 of the medical device 200,another storage unit of the medical device 200, or an external database,such as the local database unit 255 or a remote database unit 250. Themedical device 200 may communicate the indication via the communicationsunit 260. Alternatively or in addition to an external database, themedical device 200 may be adapted to communicate the indication to atleast one of a patient, a caregiver, or a healthcare provider.

In various embodiments, one or more of the units or modules describedabove may be located in a monitoring unit 270 or a remote device 292,with communications between that unit or module and a unit or modulelocated in the medical device 200 taking place via communication unit260. For example, in one embodiment, one or more of the cardiac datacollection module 265, the heart beat/interval determination module 275,the heart beat validation module 285, the window analysis module 295,the foreground/background module 297, or the seizure detection module299 may be external to the medical device 200, e.g., in a monitoringunit 270. Locating one or more of the cardiac data collection module265, the heart beat/interval determination module 275, the heart beatvalidation module 285, the window analysis module 295, theforeground/background module 297, or the seizure detection module 299outside the medical device 200 may be advantageous if the calculation(s)is/are computationally intensive, in order to reduce energy expenditureand heat generation in the medical device 200 or to expeditecalculation.

The monitoring unit 270 may be a device that is capable of transmittingand receiving data to and from the medical device 200. In oneembodiment, the monitoring unit 270 is a computer system capable ofexecuting a data-acquisition program. The monitoring unit 270 may becontrolled by a healthcare provider, such as a physician, at a basestation in, for example, a doctor's office. In alternative embodiments,the monitoring unit 270 may be controlled by a patient in a systemproviding less interactive communication with the medical device 200than another monitoring unit 270 controlled by a healthcare provider.Whether controlled by the patient or by a healthcare provider, themonitoring unit 270 may be a computer, preferably a handheld computer orPDA, but may alternatively comprise any other device that is capable ofelectronic communications and programming, e.g., hand-held computersystem, a PC computer system, a laptop computer system, a server, apersonal digital assistant (PDA), an Apple-based computer system, acellular telephone, etc. The monitoring unit 270 may download variousparameters and program software into the medical device 200 forprogramming the operation of the medical device, and may also receiveand upload various status conditions and other data from the medicaldevice 200. Communications between the monitoring unit 270 and thecommunication unit 260 in the medical device 200 may occur via awireless or other type of communication, represented generally by line277 in FIG. 2. This may occur using, e.g., wand 155 (FIG. 1) tocommunicate by RF energy with an implantable signal generator 110.Alternatively, the wand may be omitted in some systems, e.g., systems inwhich the MD 200 is non-implantable, or implantable systems in whichmonitoring unit 270 and MD 200 operate in the MICS bandwidths.

In one embodiment, the monitoring unit 270 may comprise a local databaseunit 255. Optionally or alternatively, the monitoring unit 270 may alsobe coupled to a database unit 250, which may be separate from monitoringunit 270 (e.g., a centralized database wirelessly linked to a handheldmonitoring unit 270). The database unit 250 and/or the local databaseunit 255 are capable of storing various patient data. These data maycomprise patient parameter data acquired from a patient's body, therapyparameter data, seizure severity data, and/or therapeutic efficacy data.The database unit 250 and/or the local database unit 255 may comprisedata for a plurality of patients, and may be organized and stored in avariety of manners, such as in date format, severity of disease format,etc. The database unit 250 and/or the local database unit 255 may berelational databases in one embodiment. A physician may perform variouspatient management functions (e.g., programming parameters for aresponsive therapy and/or setting thresholds for one or more detectionparameters) using the monitoring unit 270, which may include obtainingand/or analyzing data from the medical device 200 and/or data from thedatabase unit 250 and/or the local database unit 255. The database unit250 and/or the local database unit 255 may store various patient data.

One or more of the blocks illustrated in the block diagram of themedical device 200 in FIG. 2A or FIG. 2B, may comprise hardware units,software units, firmware units, or any combination thereof.Additionally, one or more blocks illustrated in FIG. 2A-B may becombined with other blocks, which may represent circuit hardware units,software algorithms, etc. Additionally, any number of the circuitry orsoftware units associated with the various blocks illustrated in FIG.2A-B may be combined into a programmable device, such as a fieldprogrammable gate array, an ASIC device, etc.

The medical device system of one embodiment of the present inventionprovides for software module(s) that are capable of acquiring, storing,and processing various forms of data, such as patient data/parameters(e.g., physiological data, side-effects data, heart rate data, breathingrate data, brain-activity parameters, disease progression or regressiondata, quality of life data, etc.) and therapy parameter data. Therapyparameters may include, but are not limited to, electrical signalparameters (e.g., frequency, pulse width, wave shape, polarity, on-time,off-time, etc.) that define therapeutic electrical signals delivered bythe medical device in response to the detection of the seizure,medication type, dose, or other parameters, and/or any other therapeutictreatment parameter.

In one embodiment, the present invention may include coupling of atleast one electrode to each of two or more cranial nerves. (In thiscontext, two or more cranial nerves mean two or more nerves havingdifferent names or numerical designations, and do not refer to the leftand right versions of a particular nerve). In one embodiment, at leastone electrode may be coupled to either or both vagus nerves or a branchof either or both vagus nerves. The term “operatively” coupled mayinclude directly or indirectly coupling. Each of the nerves in thisembodiment or others involving two or more cranial nerves may bestimulated according to particular activation modalities that may beindependent between the two nerves.

Returning to systems for providing cranial nerve stimulation, such asthat shown in FIG. 1, and as stated above, alternatively or in additionto a responsive treatment, if any, cranial nerve stimulation may beprovided on a continuous basis to alleviate chronic aspects of thepatient's medical disorder. Where cranial nerve stimulation is providedbased solely on programmed off-times and on-times, the stimulation maybe referred to as passive, inactive, open-loop, non-feedback, ornon-contingent stimulation. In contrast, stimulation may be triggered byone or more feedback loops according to changes in the body or brain ofthe patient. This stimulation may be referred to as active, closed-loop,feedback-loop, or contingent stimulation. In one embodiment,feedback-loop stimulation may be manually-triggered stimulation, inwhich the patient manually causes the activation of a pulse burstoutside of the programmed on-time/off-time cycle at a time of thepatient's choosing, for example, in response to a sensation of animpending seizure. The patient may manually activate an implantablesignal generator 110 to stimulate the cranial nerve, such as vagus nerve127, to treat an acute episode of a medical condition, e.g., a seizure.The patient may also be permitted to alter the intensity of the signalsapplied to the cranial nerve within limits established by the physician.

Patient activation of a medical device 100 may involve use of anexternal control magnet for operating a reed switch in an implanteddevice, for example. Certain other techniques of manual and automaticactivation of implantable medical devices are disclosed in U.S. Pat. No.5,304,206 to Baker, Jr., et al. (“the '206 patent”). According to the'206 patent, means for manually activating or deactivating theelectrical signal generator 110 may include a sensor such aspiezoelectric element mounted to the inner surface of the generator caseand adapted to detect light taps by the patient on the implant site. Oneor more taps applied in fast sequence to the skin above the location ofthe electrical signal generator 110 in the patient's body may beprogrammed into the implanted medical device 100 as a signal forintensification of the electrical signal. Two taps spaced apart by aslightly longer duration of time may be programmed into the medicaldevice 100 to indicate a desire to de-intensify the electrical signal.The patient may be given limited control over operation of the device toan extent which may be determined by the program or entered by theattending physician. The patient may also activate the medical device100 using other suitable techniques or apparatus.

In one embodiment, the medical device 200 may also be capable ofdetecting a manual input from the patient. The manual input may includea magnetic signal input, a tap input, a wireless data input to themedical device 200, etc.

Turning now to FIG. 3A, a more detailed stylized depiction of thecardiac data collection module 265 of FIG. 2, in accordance with oneillustrative embodiment of the present invention is depicted. In oneembodiment, the cardiac data collection module 265 comprises a cardiacdata signal receiver 410, an analog-to-digital converter (A/D Converter)420, and a cardiac data forwarding unit 425. The cardiac data signalreceiver 410 is capable of receiving the signals from the sensor(s) 212via receiver circuit 412. The signal that is received by the receivercircuit 412 is processed and filtered to enable the data to be furtheranalyzed and/or processed for determining a fiducial time marker of aheart beat.

The cardiac data signal receiver 410 may comprise amplifier(s) 414 andfilter(s) 416. The amplifiers 414 are capable of buffering andamplifying the input signals received by the receiver circuit 412. Inmany cases, the heart beat signal may be attenuated and may becharacterized by significantly low amplitude responses and signal noise.The amplifier(s) 414 are capable of buffering (amplification by unity)and amplifying the signals for further processing. In one embodiment,the amplifier 414 may comprise op amp circuit(s), digital amplifier(s),buffer amplifiers, and/or the like.

The cardiac data signal receiver 410 may also comprise one or morefilters 416. The filters 416 may comprise analog filter(s), digitalfilter(s), filters implemented by digital signal processing (DSP) meansor methods, etc. The amplified and buffered heart beat signal may befiltered to remove various noise signals residing on the heart beatsignal. The filter 416, for example, is capable of filtering out variousnoise signals caused by external magnetic fields, electrical fields,noise resulting from physiological activity, etc. Filtering, signalnoise due to breathing or other signals produced by the patient's bodymay be filtered.

The cardiac data signal receiver 410 provides amplified, filteredsignals to the A/D converter 420. The A/D converter 420 performs ananalog-to-digital conversion for further processing. The A/D converter420 may be one type of a plurality of converter types with variousaccuracies, such as an 8-bit converter, a 12-bit converter, a 24-bitconverter, a 32-bit converter, a 64-bit converter, a 128-bit converter,a 256-bit converter, etc. The converted digital signal is then providedto a cardiac data forwarding unit 425. In an alternative embodiment, theA/D conversion may be performed prior to filtering or signal processingof the heart beat signal. The converted digital signal is then providedto a cardiac data forwarding unit 425.

The cardiac data forwarding unit 425 is capable of organizing,correlating, stacking, and otherwise processing the digitized, buffered,and filtered cardiac data and forwarding it to the heart beat/intervaldetermination module 275. The cardiac data forwarding unit 425 maycorrelate various time stamps with the heart beat signal to provide atime of beat sequence of the patient's heart, or more accurately a timeof beat sequence of candidate heart beats subject to further processingand/or testing in, e.g., subsequent modules 275, 285, 297, 295, and 299.The digital signals issuing from the cardiac data forwarding unit 425,comprising a time stamp sequence of candidate heart beats, may then beforwarded to the heart beat/interval calculation module 275.

Turning now to FIG. 3B, a more detailed stylized depiction of the heartbeat/interval determination module 275 of FIG. 2, in accordance with oneillustrative embodiment of the present invention, is depicted. The heartbeat/interval determination module 275 may comprise a cardiac datareceiving module 430, for receiving a time stamp sequence of candidateheart beats, a heart beat interval determination module 440, and a heartbeat/interval time series storage unit 450. The heart beat/intervaldetermination module 275 may determine interbeat intervals for adjacentcandidate heart beats as they appear in the time series of signals viathe cardiac data receiving module 430. For example, cardiac datareceiving module 430 may characterize certain data points in the timeseries of signals as being fiducial time markers corresponding to, forexample, the start, the peak, or the end of an R-wave of a patient'scardiac cycle.

Once fiducial time markers are determined from the time series ofsignals, the heart beat interval determination module 440 may determinethe interval between consecutive beats (“interbeat interval”) andforward this information to heart beat/interval time series storage 450,which may store one or both of a time stamp series associated withfiducial markers indicating of an individual heart beat and a time stampseries of adjacent interbeat intervals. In some embodiments, beatinterval determination module 440, may also calculate other values fromthe time sequence of candidate heart beats, such as an instantaneous HR.

Turning now to FIG. 3C, a more detailed stylized depiction of the heartbeat validation module 285 of FIG. 2, in accordance with oneillustrative embodiment of the present invention, is depicted. The heartbeat validation module 285 may receive various data from the heartbeat/interval determination module 275. Heat beat validation module 285tests candidate heart beats and/or intervals received from heartbeat/interval calculation module 275 to one or more beat validity tests.The outcome of the beat validity tests may be used to discard candidateheart beats from further analysis, and the valid beats are then passedto window analysis module 295.

In the depiction shown in FIG. 3C, data received from the heartbeat/interval determination module 275 is forwarded to heart beatvalidation module 285. The data is initially sent to a physiologicallyplausible heart beat interval unit 505, which determines whether theinterbeat interval is physiologically plausible (i.e., whether aninterbeat interval determined from a candidate heart beat and animmediately preceding beat is within a range typically seen in humanphysiology). In one embodiment, this may involve comparing the interbeatinterval for the candidate heart beat with an upper and a lower beatinterval duration threshold and declaring invalid the candidate heartbeat as invalid if it lies outside of the upper and lower thresholds. Inone embodiment this corresponds to ensuring that the interbeat intervalcorresponds to a heart rate of between about 35 BPM and about 180 BPM.

Valid beats may from physiologically plausible heart beat interval unit505 are then be forwarded to apparent missed heartbeat unit 510, whichdetermines whether the interbeat interval is so long as to appear to bedue to a missed heartbeat and therefore invalid. In one embodiment, theapparent missed heartbeat unit 510 tests the interbeat interval for thecandidate heart beat to ensure that the interval is not more than about115 percent (or another acceptable percentage exceeding 100%) of thegreater of 1) the immediately preceding valid beat interval or 2) arecent baseline heart rate. Other tests may used, so long as the testensures that the beat interval is not excessively long and likely due toa missed beat. Candidate beats failing the test(s) of the apparentmissed heart beat unit 510 are discarded, and the remaining beats areforwarded to apparent noise unit 515.

In contrast to apparent missed heart beat unit 510—which tests candidateheart beat to ensure that the interbeat interval is not excessivelylong—apparent noise unit 515 tests candidate heart beats to ensure thatthe interbeat interval associated with the candidate beat is not soshort as to appear to be due to noise, in which case the candidate heartbeat is discarded. In one embodiment, the apparent noise unit 515 teststhe interbeat interval for the candidate heart beat to ensure that theinterval is at least a certain minimum length. In particularembodiments, the minimum length may be a fixed duration, such as about ⅓sec (i.e., corresponding to an IHR of at most 180 BPM), or at least atarget minimum percentage of a recent target interbeat interval, such asat least 65 percent of the smaller of either 1) the immediatelypreceding valid interbeat interval or 2) an interbeat intervalcorresponding to a recent baseline heart rate. If not, the candidateheart beat is declared invalid.

Candidate beats passing the “short duration” tests of the apparent noiseunit 515 are forwarded to slope unit 520, which determines whether theabsolute value of the slope of a plurality of interbeat intervalspreceding the candidate heart beat interval is so large as to be outsidethe range of physiologically valid slopes and therefore invalid. In oneembodiment, the slope unit determines the slope of the interbeatintervals for the candidate beat and the immediately preceding validbeat, and compares the slope to an upper slope threshold. In aparticular embodiment, the slope unit determines if the absolute valueof the slope is less than or equal to 0.3, although other thresholds,such as an adaptable threshold, may be used instead of a fixedthreshold. If the slope exceeds the slope threshold, the candidate heartbeat is discarded as invalid.

The candidate heart beats passing the one or more tests of heart beatvalidation unit 285 (e.g., physiologically plausible heart beat intervalunit 505, apparent missed heart beat unit 510, apparent noise unit 515,and slope unit 520) are accepted as valid beats. Data for the validbeats (which may comprise time stamps of the valid beats and/orinterbeat interval durations for each candidate beat and an immediatelypreceding beat, is forwarded to window analysis module 295.

Turning now to FIG. 3D, a more detailed stylized depiction of the windowanalysis module 295 of FIG. 2, in accordance with one illustrativeembodiment of the present invention, is depicted. The window analysismodule 295 may receive various data from the heart beat validationmodule 285, such as time stamps of valid beats and/or interbeat intervaldurations. Based upon data from the heart beat validation module 285,the window analysis module 295 further tests the valid interbeatintervals to determine if they are suitable for use to detect seizureevents. Valid beats suitable for use in detecting seizures (which, asnoted earlier, may change from one window to another window) areprovided to the foreground/background module 297.

In the depiction shown in FIG. 3D, data received from the heart beatvalidation module 285 is forwarded to first window unit 555 in windowanalysis module 295. First window unit 555 forms a first window for eachvalid beat, the window including the valid beat and one or morepreceding beats. In some embodiments the first window is a time window,and in other embodiments the first window is a number-of-beats window.In a particular embodiment, first window unit 555 uses a 5 second,backward-looking time window bounded on the present end by a first validbeat being tested. First window unit 555 may also, in some embodiments,determine the number of beats in the window.

The first window from unit 555 is tested with one or more window testsin first window analysis unit 560. The window tests determine whetherthe first valid beat shows excessive dispersion in the context ofprevious heart beats. In one embodiment, the dispersion tests include atleast one short-term HRV test of the first window. In one particularembodiment, the first window analysis unit 560 calculates aleast-squares linear fit of the beats in the window, and also calculatesthe mean squared error of the least squares linear fit. The mean squarederror (MSE) can be used as a short-term HRV measure and is compared toat least one HRV threshold. If the MSE exceeds the threshold, then thefirst valid beat is discarded as unsuitable for use in seizure detectionbecause it produces unacceptably high dispersion when added to a streamof valid beats. In one embodiment, a fixed HRV threshold of 0.25 isused, and the first valid beat is discarded if the HRV exceeds 0.25.Other HRV thresholds, including adaptive thresholds that vary with time,patient status or environmental conditions, may also be used. Inparticular, nonlinear least squares fits of the data may be used insteadof the linear least-squares fit, and other models of fitting data mayalso be used depending upon the computational constraints applicable toa particular medical device. Whatever the fit chosen, short-term HRV maybe measured from the MSE, the rate of change in heart rate may beestimated from the slope of the fit, and the interbeat intervals in thewindow may be estimated from the fit. Any of these parameters can bemeasured as a simple measurement, with equal weighting to all time unitsor beat units in the window, or as an exponentially forgettingmeasurement.

First window analysis unit 560 may also perform additional window teststo assess the valid beats in the window. In one embodiment, the numberof beats in the window is tested to determine whether the number ofbeats in the window exceeds a minimum number of beats threshold for thewindow. Since only valid beats passing the HRV test may be used todetect seizure events, there may be instances when declaring invalid ofone or more beats compromises the accuracy of a seizure detectionalgorithm. Enforcing a minimum number of beats threshold may help toensure that only periods with relatively good data are used for seizuredetection. In addition to disqualified data, the number of beatsthreshold may also be used where noise or skipped beats occur but arenot filtered with the testing performed in heart beat validation module285. In one embodiment, the number of beats threshold may comprise afixed integer number of beats, for example 2 or 3 beats. In anotherembodiment, a fractional threshold may be used corresponding to, forexample, 50 BPM. In a still further embodiment, an adaptive thresholdmay be used that varies with time, patient status or condition, andenvironmental factors.

If the valid beat passes the one or more window tests of first windowanalysis unit 560, the beat is accepted as suitable for seizuredetection and forwarded to foreground/background module 297. Otherwise,the valid beat is discarded and not used for seizure detection.

Turning now to FIG. 3E, a more detailed stylized depiction of theforeground/background module 297 of FIG. 2, in accordance with oneillustrative embodiment of the present invention, is depicted. In oneembodiment, the foreground/background module 297 may receive variousdata indicative of valid beats suitable for seizure detection from thewindow analysis module 295. This may include time stamp data for validbeats suitable for seizure detection, and/or fiducial time markersassociated with such beats. Based upon data from the window analysismodule 295, the foreground/background module 297 is capable ofcalculating a short-term indication of HR and a longer-term indicationof HR for ultimate use in seizure identification module 299 to detect aseizure event.

Data from window analysis module 295 is received by foreground HR unit565, which forms a second window for each of the valid beats suitablefor seizure detection. The second window includes a first valid beatsuitable for seizure detection and at least one prior valid beatsuitable for seizure detection. The second window preferably includes aplurality of consecutive interbeat intervals. In one embodiment, thesecond window is a backward-looking time window bounded at one end by afirst valid beat suitable for seizure detection and including at leastone prior valid beat suitable for seizure detection. In one embodiment,the second window may be the same size is the first time window frommodule 555. In a particular embodiment, the window is a three second,backward-looking window, or an exponentially-forgetting window withcomparable weighting. A relatively short foreground windowadvantageously tracks heart changes quickly, enabling faster detectionof epileptic seizures. The window size may be optimized to balance thedesire for fast seizure detection against potential false positivedetection from relatively short-lived tachycardia phenomenon such asstanding or sitting upright, climbing a flight of stairs, or sudden andtransient exertion.

A foreground heart rate parameter for the second window is determinedusing a statistical measure of central tendency of heart rate (orinterbeat intervals) for the beats (or intervals) in the second window.Commonly known measures of central tendency such as moving average, meanor median may be used in some embodiments. However, the presentinventors have determined that an improved algorithm may be obtained byusing as the measure of central tendency a target percentile value, forexample a percentile in the range of the 20^(th) to the 80^(th)percentile, in a uniform distribution-based Percentile Tracking Filterapplied to the valid beats in the second window. In a particularembodiment, the thirtieth (30^(th)), percentile of a uniformdistribution Percentile Tracking Filter is used as the measure ofcentral tendency for the sequence of successive valid interbeatintervals, updated each time the window validity test is satisfied forthe moving window ending at the heart beat that was most recentlydetermined valid. By using a percentile smaller than the 50^(th)percentile, the second window will more quickly track decreasinginterbeat intervals, which corresponds to increases in heart rate (i.e.tachycardia) that are frequently associated with epileptic seizures. Itshould be noted that if the FHR parameter uses heart rate instead ofinterbeat intervals, the heart rate would track the 70^(th) percentileto track increases in heart rate faster than decreases because, as notedpreviously, heart rate and interbeat intervals are inversely related.

Parameters may also be used to describe the uniform distribution used inthe Percentile Tracking Filter to improve performance of the algorithm.In particular, upper and lower bounds for the uniform distribution maybe specified to improve the ability of the algorithm to more accuratelytrack the target percentile used in the PTF. Additional parameters mayalso be used to provide a weighting factor to the PTF, including forexample forgetting factors used to weight the HR to emphasize morerecent heart beats more than prior beats. Such exponential forgettingmay be used to adaptively track the recent minimum and maximum validinterbeat intervals and use these as adaptive parameters describing theuniform distribution used by the PTF. Persons of skill in the art,provided with the present disclosure and a knowledge of the prior art,will appreciate that other models may be used in the PTF for thetime-varying distribution of interbeat intervals, as described in U.S.Pat. No. 6,768,968, U.S. Pat. No. 6,904,390, and U.S. Pat. No.7,188,053, previously incorporated by reference.

Returning to FIG. 3E, data from window analysis module 295 is also usedin background HR unit 567, which forms a third window for each of thevalid beats suitable for seizure detection. The third window includesthe first valid beat suitable for seizure detection from the secondwindow and at least two prior valid beat suitable for seizure detection,and is used to provide a longer-term (“background”) measure of HR thanthe second (foreground) window. In one embodiment, the third window is abackward-looking time window that is longer than the second window,bounded at the present end by the first valid beat from the secondwindow.

In a particular embodiment, the third window is a 500 second window, oran exponentially forgetting window with time weighting on a timescale of500 sec, bounded on the present side by the first valid beat from thesecond window. The third window size may be made larger or smaller tosmooth our or reveal local perturbations of patient HR. In manyembodiments, it may be desirable to smooth small-scale fluctuations inHR, such as those associated with transient tachycardia eventspreviously discussed (e.g., standing, sitting upright, climbing stairs,sudden exertion).

A background HR parameter for the third window is obtained using astatistical measure of central tendency of heart rate for the beats inthe third window. As noted regarding the foreground HR parameter, anumber of measures of central tendency (e.g., mean, median) may be used.In one embodiment, a target percentile value (for example, a value inthe range from the 30^(th) percentile to the 70^(th) percentile) in auniform distribution Percentile Tracking Filter applied to the validbeats in the second window is used as the measure of central tendency.In a particular embodiment, the fiftieth (50^(th)) percentile of auniform distribution Percentile Tracking Filter is used as the measureof central tendency. In one particular embodiment, the PercentileTracking Filter is an exponentially forgetting Percentile TrackingFilter. Other types weighted and unweighted Percentile Tracking Filtersor other measures of central tendency may be used.

Upper and lower limits or bounds for the uniform distribution used inthe background Percentile Tracking Filter may be provided. In someembodiments these limits may be adaptively determined based upon themaximum and minimum value of the beat intervals in the second relativelyshort window such a moving average (mean) or median.

The foreground HR and background HR values determined in units 565 and567 may in some embodiments be forwarded to seizure identificationmodule 299 without further processing in foreground/background module297. In other embodiments, foreground/background module 297 performsadditional calculations. In particular, an instantaneous heart ratecalculation unit 569 may determine an IHR for every valid beat suitablefor seizure detection. Certain embodiments of the invention may alsoinclude a short-term HR threshold unit 571 which determines a timeduration that the IHR determined by calculation unit 569 continuouslyexceeds a short-term HR threshold. If the IHR continuously exceeds theshort-term HR threshold for a short-term duration threshold, a seizureevent may be declared as occurring. Alternatively, the IHR continuouslyexceeds the short-term HR threshold for the short-term durationthreshold may be required in addition to the RHR threshold determined inmodule 299.

In certain embodiments, the invention may also comprise a slope durationcalculation unit 573. This unit determines the instantaneous slope of HR(ISHR) and compares the slope to a short-term HR slope threshold. If theISHR exceeds the short-term HR slope threshold for a slope durationthreshold, a seizure event may be declared on that basis alone, or maybe required in addition to the RHR exceeding its threshold determined inmodule 299. The foreground/background module 297 need not perform allsteps 565-573. Any steps the foreground/background module 297 performsmay be in any order, not necessarily that shown.

Although the IHR calculation unit 569, the short-term heart ratethreshold unit 571, and the slope duration calculation unit 573 areshown in FIG. 3E as components of foreground/background module 297, invarious other embodiments, one or more of these units can be included inother modules, such as window analysis module 295.

Turning now to FIG. 3F, a more detailed stylized depiction of theseizure detection module 299 of FIG. 2, in accordance with oneillustrative embodiment of the present invention, is depicted. Theseizure detection module 299 may receive various data from theforeground/background module 297, including, for example, the foregroundHR parameter and the background HR parameter. Based upon data from theforeground/background module 297, the seizure detection module 299 iscapable of identifying a seizure event, such as described above.

In the exemplary depiction shown in FIG. 3F, data received from theforeground/background module 297 is forwarded to a relative heart rate(RHR) determination unit 587, which determines one or more relationshipsbetween two or more of the FHR, the BHR, the instantaneous heart rate(IHR), the short-term heart rate threshold, the short-term heart rateduration threshold, the ISHR, the short-term HR slope threshold, and theslope duration threshold. In a preferred embodiment, the RHRdetermination unit determines at least a RHR, although as discussedabove any number of additional HR parameters and thresholds for suchparameters may be determined and forwarded to seizure identificationunit 589, which determines from one or more of the calculated values,the relationships, or both whether a seizure is identified.

In one embodiment, seizure identification unit 589 determines whether ornot a seizure has based upon whether the RHR exceeds a seizure thresholdvalue. The RHR is compared to the seizure threshold, and whether the RHRexceeds the RHR threshold is determined A signal indicative of theoccurrence of a seizure event is provided based upon the comparison. Inone embodiment, the threshold may be a fixed numerical threshold. Theseizure threshold value is preferably one that reflects heart ratechanges typically seen for the patient's seizure. In patients whoseseizures are accompanied with tachycardia (accelerated heart rate), theseizure threshold is greater than one. Because the foreground heart rateis collected over a shorter time window than the background heart rate,a threshold greater than one reflects an increase in a short term heartrate over a baseline, long term heart rate. In one embodiment, theseizure threshold value is 1.3. For patients experiencing bradycardia inconjunction with seizures the threshold is less than one (oralternatively the BHR/FHR ratio is used instead of FHR/BHR). On theother hand, if the patient's seizures are accompanied with bradycardia(reduced heart rate), the threshold is generally less than one. Theprecise value of the threshold can be set by a physician in consultationwith the patient, and may be periodically adjusted. It will beappreciated that for bradycardia-based detection, detections occur whenthe FHR/BHR ratio is below the threshold (or BHR/FHR is above thethreshold) and the duration constraint is time spent at or below thethreshold.

In one embodiment, an adaptive seizure threshold is used, and isdetermined based upon the actual ratio of the FHR and the BHRexperienced by the patient during one or more seizure events. In anotherembodiment, the threshold may adaptively change based upon one or morevariables such as the patient's level of exertion, the time of day, thenumber of false positive seizure detections (i.e., detection events thatdo not correspond to an actual seizure event), the number of falsenegative seizure detections (i.e., actual seizures for which nocorresponding detection event occurred, changes in the patient's diseasestate, whether the patient is engaged in a high-risk activity such asswimming or driving, etc

As noted above, generation of a seizure occurrence signal may dependupon more than the RHR alone exceeding a threshold. For example, thelogic associated with generating the seizure occurrence signal mayrequire that the RHR exceed the seizure threshold for a specifiedduration. In addition or alternatively, the seizure detection logic mayrequire that a short-term HR parameter (such as IHR or the FHR) mustexceed a short-term HR threshold (e.g., a fixed threshold of 110 BPM oran adaptive short-term threshold of an increase of 30 BPM from the BHRvalue at the time the RHR exceeded its seizure threshold) before thesignal is generated. Additional thresholds for instantaneous slope andthe duration of an instantaneous slope measurement exceeding a thresholdmay also be required.

If a seizure is identified by seizure identification module 299, in oneembodiment, a response may be implemented. Based upon theidentification, the medical device 200 may initiate one or more ofseveral responsive actions, including generating an indication of atleast one of a seizure or an impending seizure. This indication may bestored internally and/or externally, e.g., in the memory 217 (FIG. 2).This indication may also be transmitted to an entity separate from themedical device 200, e.g., to the monitoring unit 270 or monitoring andtreatment unit 610 (FIG. 4), and stored, e.g., into the local databaseunit 255 and/or the database unit 250 (FIG. 2). The medical device 200may initiate other responsive actions such as providing an audible,visible, or tactile alert to the patient or a caregiver; logging atimestamp of the seizure; initiation of a seizure severity determinationroutine based upon data from the heart beat/interval determinationmodule 275, the foreground/background module 297, and/or the seizuredetection module 299; communicating with one or more of database unit250 or remote device 292, or notifying emergency services via email orautophone communications. It may be appreciated that, based upon theidentification of a seizure by the seizure detection module 299,responsive action(s) may be performed by either the MD 200, monitoringunit 270, or other devices such as remote device 292.

In another embodiment, a preventive therapy or an interventive therapymay be performed as a responsive action. The therapy may comprise, forexample, an electrical stimulation of the vagus nerve 127.

Alternatively or in addition to detecting a seizure and providing asignal indicating its occurrence, according to one embodiment of thepresent invention as shown in FIG. 4, a monitoring and treatment unit610, which may be a monitoring unit 270 or a unit other than medicaldevice 200 implanted in or attached to an external portion of thepatient's body, is provided. The monitoring and treatment unit 610 maycomprise a reporting module 620 to receive an indication of an occurringor impending epileptic event from the medical device 200 and a treatmentunit 630 that can provide a therapy, such as an electrical signal to aneural structure of a patient, a drug delivery device, or a device thatcan cool a neural structure of a patient. In one embodiment, the medicaldevice 200 may be external to the patient's body and the monitoring andtreatment unit 610 may comprise a wholly or partially implanted system.More specifically, treatment unit 630 may be an implanted unit withprogrammed electrical parameters (e.g., amplitude, pulse width,frequency, on-time, off-time, etc.) that defines a therapeuticstimulation signal provided by a stimulation unit 220 (FIG. 2B) to theelectrodes 128 via the leads 201 (FIG. 2B). Reporting module 620 may beimplanted or external to the patient's body.

Turning now to FIG. 5, a stylized flowchart depiction of detecting aseizure event, in accordance with one illustrative embodiment of thepresent invention, is provided. The medical device 200 receives a heartbeat signal (block 710). Typically, the cardiac data collection module265 (FIGS. 2 and 3A) of the medical device 200 receives the heart beatsignal. After performing buffering, amplification, filtering, and A/Dconversion of the heart beat signal, the heart beat/intervaldetermination module 275 and window analysis module 295 processes theheart beat signal to derive valid beat data (block 720). From the validbeat data, it is decided from one or more calculations if seizure isoccurring (block 730). This decision may be performed by seizureidentification module 299. A more detailed description of the step ofdeciding if the seizure is occurring is provided in FIG. 6 and theaccompanying description below.

Based upon the decision (block 730), if no seizure is occurring, themedical device 200 continues to receive the heart beat signal (block750, returning flow to block 710).

However, if the medical device 200 decides a seizure is occurring inblock 730, the medical device 200 or an external unit 270 may provide anindication of the seizure occurrence and/or take a responsive action(block 760), such as providing a warning to the patient or his or hercaregivers, physician, etc. (block 775); logging a time of seizure(block 777); computing and optionally logging one or more seizureseverity indices (block 779); and/or providing treatment of the seizure(block 781).

The warning 775 may manifest as a warning tone or light implemented by anearby object adapted to receive the indication of a seizure event fromthe medical device 200; an automated email, text message, telephonecall, or video message sent from the medical device 200, either directlyor via an monitoring unit 270, to the patient's cellular telephone, PDA,computer, television, etc. Such a warning may allow the patient or hisor her caregivers to take measures protective of patient's well-beingand those of others, e.g., pulling out of traffic and turning off a car,when the patient is driving; stopping the use of machinery, contactinganother adult if the patient is providing childcare, removing thepatient from a swimming pool or bathtub, lying down or sitting if thepatient is standing, etc.

The time of the seizure event may be logged 777 by taking a time stampof the decision 730 and storing it in a memory of the medical device 200or the external unit 270.

One or more seizure severity indices may be computed 779 from valid beatdata, such as the duration of elevation of a shorter time window heartrate above a baseline heart rate, a slope of a short time window heartrate, heart rate variability or the slope of heart rate variability inone or more time or number-of-beat windows, and/or an area under thecurve of a short time window heart rate relative to a baseline heartrate, among others. Though not to be bound by theory, it is reasonableto conclude that, for at least some types of seizures, an increase inheart rate, slope of heart rate, heart rate variability, slope of heartrate variability, area under the curve of heart rate relative tobaseline, etc. and the absolute and/or relative durations of suchchanges provide a reasonable approximation of seizure severity as itwould be measured electroencephalographically, without the difficulty incollecting, storing, and analyzing the volume of EEG data required tocalculate seizure severity under traditional measures of seizureseverity. The seizure severity index or indices may be logged 779 aswell.

Turning now to FIG. 6 a stylized flowchart depiction of providing atreatment based upon identifying a seizure (blocks 760 and 781 of FIG.5), according to one embodiment of the invention, is provided. In someembodiments, upon identifying a seizure, the medical device 200determines which of a plurality of treatment(s) to perform (block 910).This determination is made based upon predetermined rules set up by ahealthcare professional. The treatments may be one or more of electricalsignal therapy, drug therapy, and/or neural cooling therapy.

With regard to an electrical stimulation treatment, the parameters ofelectrical signal therapy (including an “on time” of zero milliseconds,i.e., the application of no electrical signals) are selected (block920). Similarly, the drug and dosage of drug therapy (including a dosageof zero milligrams, i.e., the application of no drugs) are selected(block 930) and the parameters of cooling a neural structure (includingthe maintenance of the ambient temperature of the neural structure,i.e., no cooling) are selected (block 940). Thereafter, the electricalsignal, drug, or cooling are applied, delivered, or performed (blocks950, 960, and 970). The combination of treatment, if any, may bedetermined based upon one or more values determined by the heartbeat/interval determination module 275, heart beat validation module285, the foreground/background module 297, or the seizure detectionmodule 299.

Particular embodiments may combine or eliminate one or more of thetreatment therapies available. Thus, a given device may comprise onlyelectrical signal therapy, only drug delivery therapy, or combinationsof any of the foregoing therapies.

The above methods may be performed by a computer readable programstorage device encoded with instructions that, when executed by acomputer, perform the method described herein.

All of the methods and apparatuses disclosed and claimed herein may bemade and executed without undue experimentation in light of the presentdisclosure. While the methods and apparatus of this invention have beendescribed in terms of particular embodiments, it will be apparent tothose skilled in the art that variations may be applied to the methodsand apparatus and in the steps, or in the sequence of steps, of themethod described herein without departing from the concept, spirit, andscope of the invention, as defined by the appended claims. It should beespecially apparent that the principles of the invention may be appliedto selected cranial nerves other than, or in addition to, the vagusnerve to achieve particular results in treating patients havingepilepsy, depression, or other medical conditions.

The particular embodiments disclosed above are illustrative only as theinvention may be modified and practiced in different but equivalentmanners apparent to those skilled in the art having the benefit of theteachings herein. Furthermore, no limitations are intended to thedetails of construction or design herein shown other than as describedin the claims below. It is, therefore, evident that the particularembodiments disclosed above may be altered or modified and all suchvariations are considered within the scope and spirit of the invention.Accordingly, the protection sought herein is as set forth in the claimsbelow.

1.-24. (canceled)
 25. A system, comprising: a cardiac data collector adapted to collect cardiac data from a patient's heart, said cardiac data comprising a time series of fiducial time markers for candidate heartbeats; a first module adapted to identify valid beats from said candidate heartbeats by subjecting a plurality of candidate beats to at least one beat validity test, said at least one beat validity test comprising at least one beat interval test applied to a candidate beat interval derived from a candidate heartbeat and at least one preceding heartbeat; and accept as valid beats the candidate beats that pass said at least one beat validity test; a second module adapted to form a first window comprising a first valid beat and at least one prior beat, wherein said first window is selected from: a time window of from 1 to 10 seconds, bounded on the most recent end by said first valid beat; and a number of beats window comprising said first valid beat and a number of immediately preceding beats ranging from 2-15; test said first window with at least one window test, wherein said at least one window test comprises a dispersion test; and accept the beats in said window as suitable for seizure detection if said window has a dispersion less than a threshold level of dispersion; a third module adapted to, in response to said beats in said window being accepted by said second module as suitable for seizure detection, determine a foreground heart rate parameter comprising a statistical measure of central tendency of heart rate in said first window; form a second window larger than said first window; determine a background heart rate parameter comprising a statistical measure of central tendency of heart rate in said second window; determine a relative heart rate comprising at least one of a first ratio of said foreground to said background heart rate parameters and a second ratio of said background to said foreground heart rate parameters; compare said relative heart rate to at least one of a first seizure threshold value associated with said first ratio and a second seizure threshold value associated with said second ratio; and detect an epileptic seizure if at least one of said first ratio exceeds said first seizure threshold value, or said second ratio is below said second seizure threshold value; and a medical device adapted to take a responsive action in response to said third module detecting an epileptic seizure, wherein the responsive action is selected from providing a warning to the patient or a caregiver, notifying the patient or the caregiver, logging the time of occurrence of said epileptic seizure, storing one or more seizure severity indices relating to said epileptic seizure, or treating said epileptic seizure.
 26. The system of claim 25, wherein said first module is adapted to identify valid beats at least in part by determining if each of said plurality of candidate beats falls within a plausibly physiological interval.
 27. The system of claim 26, wherein said beat validity test comprises comparing said candidate beat interval to at least one of an upper beat interval threshold and a lower beat interval threshold.
 28. The system of claim 27, wherein said upper and lower beat interval thresholds are derived from at least one of the patient's own heartbeat data, and heartbeat data from a sample patient population based upon one or more of brain state, sex, age, weight, level of activity, time of day, type of epilepsy, use of drugs or substances (such as food) that affect cardiac function, ambient temperature, body temperature, respiration, and blood pressure.
 29. The system of claim 25, wherein said at least one beat interval test comprises: a) determining that said candidate beat interval corresponds to a heart rate within a range bound by a minimum heart rate and a maximum heart rate; b) determining that the candidate beat interval is within an acceptable percentage of at least one of the immediately preceding valid beat interval or a recent baseline heart rate in a predetermined time window; and c) determining that the absolute slope derived from the current candidate beat interval and the most recent beat interval does not correspond to a rate of change of heart rate that is physiologically improbable.
 30. The system of claim 29, wherein: a) said minimum heart rate is about 35 beats per minute and said maximum heart rate is about 180 beats per minute; b) said candidate beat interval is not more than about 115 percent of the greater of the immediately preceding valid beat interval or a recent baseline heart rate in a 30 second time window, and is at least about 65 percent of the immediately preceding valid beat interval; and c) said absolute slope of the current candidate beat interval and the most recent beat interval is ≦0.3.
 31. The system of claim 25, wherein said at least one window test comprises: a) determining whether the mean square error of a least squares linear fit of the beats in said first window is less than or equal to a predetermined heart rate variability threshold.
 32. The system of claim 25, wherein said first window comprises a time window and said at least one window test comprises determining that the number of valid beats in the window exceeds a lower number of beats threshold.
 33. The system of claim 25, wherein said third module is adapted to determine said foreground heart rate parameter at least in part by determining a target percentile value in a uniform distribution Percentile Tracking Filter in said first window.
 34. The system of claim 33, wherein upper and lower bounds for said uniform distribution are adaptively determined for said first window based upon the maximum and minimum beat intervals in said first window.
 35. The system of claim 34, wherein said target percent value of said Percentile Tracking Filter comprises a value in the range of 20 percent to 80 percent.
 36. The system of claim 25, wherein said third module is adapted to determine said background heart rate parameter at least in part by determining a target percentile value in a uniform distribution Percentile Tracking Filter in said second window.
 37. The system of claim 36, wherein said third module is further adapted to apply an exponential forgetting factor to the interbeat intervals of the heartbeats in said Percentile Tracking Filter.
 38. The system of claim 25, wherein said third module is further adapted to determine a duration of time that said first ratio exceeds said first seizure threshold value, or said second ratio is below said second seizure threshold value, and said third module is adapted to detect said epileptic seizure only if said duration exceeds a seizure duration threshold.
 39. The system of claim 25, wherein said dispersion test comprises determining the mean squared error of a least-squares linear fit of the heartbeats in the first window, and wherein said heartbeats in said window are accepted as suitable for seizure detection if said mean squared error is less than a threshold.
 40. The system of claim 25, wherein said second window is selected from: a time window of from 10 seconds to 86,400 seconds; and a number of beats window comprising from about 30 beats to about 175,00 beats.
 41. A system, comprising: a cardiac data collector adapted to collect cardiac data from the patient's heart, said cardiac data comprising a time series of fiducial time markers for candidate heartbeats; a first module adapted to identify valid beats from said candidate heartbeats by subjecting a plurality of candidate beats to at least one beat validity test, said at least one beat validity test comprising at least one beat interval test applied to a candidate beat interval derived from a candidate heartbeat and at least one preceding heartbeat; and accept as valid beats the candidate beats that pass said at least one beat validity test; a second module adapted to form a first window comprising a first valid beat and at least one prior valid beat, wherein said first window is selected from: a time window of from 1 to 10 seconds, bounded on the most recent end by said first valid beat; and a number of beats window comprising said first valid beat and a number of immediately preceding beats ranging from 2-15; and test said first window with at least one window test, wherein said at least one window test comprises determining whether the mean square error of a least squares linear fit of the beats in said first window is less than a threshold; a third module adapted to determine a foreground heart rate parameter comprising a statistical measure of central tendency of heart rate in said first window, in response to determining that the mean square error of a least squares linear fit of the beats in said first window is less than a threshold; form a second window larger than said first window; determine a background heart rate parameter comprising a statistical measure of central tendency of heart rate in said second window; determine a relative heart rate comprising at least one of a first ratio of said foreground to said background heart rate parameters and a second ratio of said background to said foreground heart rate parameters; compare said relative heart rate to at least one of a first seizure threshold value associated with said first ratio, a second seizure threshold value associated with said first ratio, a third seizure threshold value associated with said second ratio, and a fourth seizure threshold value associated with said second ratio; and detect an epileptic seizure if at least one of said first ratio exceeds said first seizure threshold value, said first ratio is below said second seizure threshold value, said second ratio is below said first seizure threshold value, or said second ratio exceeds said second seizure threshold value; and a medical device adapted to take a responsive action in response to said third module detecting an epileptic seizure, wherein the responsive action is selected from providing a warning to the patient or a caregiver, notifying the patient or the caregiver, logging the time of occurrence of said epileptic seizure, storing one or more seizure severity indices relating to said epileptic seizure, or treating said epileptic seizure.
 42. A system, comprising: a cardiac data collection module adapted to collect cardiac data from the patient's heart, said cardiac data comprising a time series of fiducial time markers for candidate heartbeats; a heartbeat determination module adapted to identify a series of candidate beat intervals from pairs of adjacent candidate heartbeats; a heartbeat validation module adapted to test at least a plurality of candidate heartbeats with at least one beat validity test selected from: a) determining that a beat interval determined from said candidate heartbeat and the immediately preceding valid heartbeat is less than a maximum beat interval and greater than a minimum beat interval; b) determining that a beat interval determined from said candidate heartbeat and the immediately preceding valid heartbeat is within an acceptable percentage of at least one of the immediately preceding beat interval or a recent short term beat interval measure; and c) determining that a rate of change of heart rate determined from said candidate beat and a single immediately preceding heartbeat does not correspond to a rate of change of heart rate that is physiologically improbable; and accept as valid beats each candidate heartbeat passing said at least one beat interval test; a window test module adapted to identify a plurality of beats suitable for seizure detection by forming a first window comprising a first valid beat and at least one preceding heartbeat, wherein said first window is selected from a time window of from 1 to 10 seconds, bounded on the most recent end by said first valid beat; and a number of beats window comprising said first valid beat and a number of immediately preceding beats ranging from 2-15; and test said beats in said first window with at least one window test, wherein said at least one window test comprises determining whether the mean square error of a least squares linear fit of the beats in said first window is less than a dispersion threshold; a foreground/background module adapted to determine, in response to determining that the mean square error of a least squares linear fit of the beats in said first window is less than said dispersion threshold, a foreground heart rate parameter comprising a statistical measure of central tendency in said first window; form a background window larger than said first window; determine a background heart rate parameter comprising a statistical measure of central tendency in said background window; a seizure detection module adapted to determine a relative heart rate parameter comprising at least one of the ratio of said foreground to said background heart rate parameters and the ratio of said background to said foreground heart rate parameters; compare said relative heart rate parameter to a seizure threshold value; and detect the occurrence of a seizure event if said relative heart rate parameter crosses said seizure threshold value.
 43. The system of claim 42, wherein said seizure detection module is further adapted to determine a duration of time that said relative heart rate parameter exceeds said seizure threshold value; and detect said epileptic seizure only if said duration exceeds a seizure duration threshold. 